結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー | subsn |
提出日時 | 2023-06-16 16:55:03 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 469 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 09:30:16 |
合計ジャッジ時間 | 941 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | WA | - |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | main(n1,n2,l1,l2,i) | ^~~~ main.c: In function 'main': main.c:1:1: warning: type of 'n1' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'n2' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'l1' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'l2' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:5:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%s\n%s",s1,s2); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(n1,n2,l1,l2,i) main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%s\n%s",s1,s2); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:8:12: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 8 | l1=strlen(s1); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen' +++ |+#include <string.h> 1 | main(n1,n2,l1,l2,i) main.c:8:12: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch] 8 | l1=strlen(s1); | ^~~~~~ main.c:8:12: note: include '<string.h>' or provide a declaration of 'strlen' main.c:20:21: warning: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration] 20 | if(!isdigit(s1[i])||(s1[0]=='0'&&l1!=1)) { | ^~~~~~~ main.c:1:1: note: include '<ctype.h>' or provide a declaration of 'isdigit' +++ |+#include <ctype.h> 1 | main(n1,n2,l1,l2,i) main.c:29:9: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 29 |
ソースコード
main(n1,n2,l1,l2,i) { char s1[6]; char s2[6]; scanf("%s\n%s",s1,s2); n1=0; n2=0; l1=strlen(s1); l2=strlen(s2); for(int i=0;i<l1;i++){ n1=(n1)*10+(s1[i]-'0'); } for(int i=0;i<l2;i++){ n2=(n2)*10+(s2[i]-'0'); } if(n1>12345||n2>12345){ goto A; } for(i=0;i<l1;i++){ if(!isdigit(s1[i])||(s1[0]=='0'&&l1!=1)) { goto A; } } for(i=0;i<l2;i++){ if(!isdigit(s2[i])||(s2[0]=='0'&&l2!=1)){ goto A; } } puts("OK"); A: puts("NG"); return 0; }