結果
問題 |
No.725 木は明らかに森である
|
ユーザー |
![]() |
提出日時 | 2018-09-24 15:32:33 |
言語 | C (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 412 bytes |
コンパイル時間 | 258 ms |
コンパイル使用メモリ | 27,776 KB |
実行使用メモリ | 15,296 KB |
最終ジャッジ日時 | 2024-09-22 04:06:21 |
合計ジャッジ時間 | 6,617 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 8 |
コンパイルメッセージ
main.c: In function 'main': main.c:15:23: warning: passing argument 2 of 'strstr' makes pointer from integer without a cast [-Wint-conversion] 15 | p = strstr(a, *goal); | ^~~~~ | | | char In file included from main.c:2: /usr/include/string.h:350:58: note: expected 'const char *' but argument is of type 'char' 350 | extern char *strstr (const char *__haystack, const char *__needle) | ~~~~~~~~~~~~^~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char a[101]; char read[8]; char *goal = "treeone"; char *input = "forest"; char *p; scanf("%s", a); for (int i = 0; i < 100; i++) { p = strstr(a, *goal); do { *(p++) = *(input++); } while(*(goal) != '\0'); *(p + 7) = '\0'; } return 0; }