結果
| 問題 |
No.423 ハムスター語初級(数詞)
|
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2016-10-17 13:26:07 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 164 bytes |
| コンパイル時間 | 101 ms |
| コンパイル使用メモリ | 20,096 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 13:11:20 |
| 合計ジャッジ時間 | 603 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:12: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration]
6 | if(strcmp(n, "ham") == 0){
| ^~~~~~
main.c:2:1: note: include ‘<string.h>’ or provide a declaration of ‘strcmp’
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s", n);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
char n[51];
scanf("%s", n);
if(strcmp(n, "ham") == 0){
printf("0\n");
}
else {
printf("%sham\n", n);
}
return 0;
}
suppy193