結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
card_board01
|
| 提出日時 | 2018-09-24 15:31:57 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 403 bytes |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 27,904 KB |
| 実行使用メモリ | 15,424 KB |
| 最終ジャッジ日時 | 2024-09-22 04:05:45 |
| 合計ジャッジ時間 | 6,639 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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';
}
}
card_board01