結果
| 問題 |
No.725 木は明らかに森である
|
| コンテスト | |
| ユーザー |
fel1_X_925
|
| 提出日時 | 2018-12-13 20:22:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 734 bytes |
| コンパイル時間 | 133 ms |
| コンパイル使用メモリ | 23,296 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 04:36:44 |
| 合計ジャッジ時間 | 593 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%s", str);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void)
{
int i,j,k;
char str[100] = "";
char str2[100] = "";
scanf("%s", str);
j = 0;
k = strlen(str);
for(i = 0; i < k; i++){
if(str[i] == 't'){
if((str[i + 1] == 'r')||(str[i + 2] == 'e')||(str[i + 3] == 'e')||(str[i + 4] == 'o')||(str[i + 5] == 'n')||(str[i + 6] == 'e')){
str2[i] = 'f';
str2[i + 1] = 'o';
str2[i + 2] = 'r';
str2[i + 3] = 'e';
str2[i + 4] = 's';
str2[i + 5] = 't';
i += 6;
}
}
else{
str2[j] = str[i];
}
j++;
}
printf("%s\n", str2);
return (0);
}
fel1_X_925