結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
|
提出日時 | 2016-11-19 23:43:48 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 430 bytes |
コンパイル時間 | 437 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 06:28:22 |
合計ジャッジ時間 | 1,107 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 WA * 2 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s%s",s,t); | ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int main(void){ char s[8],t[8]; int i,l; scanf("%s%s",s,t); l = strlen(s); for(i = 0;i < l;i++){ if(s[i] < 48 || 57 < s[i]){printf("NG\n");return 0;} } if(l != 1 && s[0] == '0'){printf("NG\n");return 0;} l = strlen(t); for(i = 0;i < l;i++){ if(t[i] < 48 || 57 < t[i]){printf("NG\n");return 0;} } if(l != 1 && t[0] == '0'){printf("NG\n");return 0;} printf("OK\n"); return 0; }