結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
trymaiua1017
|
| 提出日時 | 2016-11-22 17:38:33 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 566 bytes |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 20,224 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 09:36:53 |
| 合計ジャッジ時間 | 692 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 5 WA * 8 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[6]’ [-Wformat=]
6 | scanf("%s",&a);
| ~^ ~~
| | |
| | char (*)[6]
| char *
main.c:7:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[6]’ [-Wformat=]
7 | scanf("%s",&b);
| ~^ ~~
| | |
| | char (*)[6]
| char *
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%s",&a);
| ^~~~~~~~~~~~~~
main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s",&b);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
char a[6],b[6];
int i,c;
c = 0;
scanf("%s",&a);
scanf("%s",&b);
for(i = 1;i >= 6;){
if(a[i] != 1 | a[i] != 2 | a[i] != 3 | a[i] != 4 | a[i] != 5 | a[i] != 6 | a[i] != 7 |
a[i] != 8 | a[i] != 9){
c = 1;
break;
}else if(b[i] != 1 | b[i] != 2 | b[i] != 3 | b[i] != 4 | b[i] != 5 | b[i] != 6 | b[i] != 7 |
b[i] != 8 | b[i] != 9){
c = 1;
break;
}else{
i++;
}
}
if(c == 1){
printf("NG");
}else{
printf("OK");
}
return 0;
}
trymaiua1017