結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-11-21 13:39:17 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 691 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 09:27:06 |
合計ジャッジ時間 | 820 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 12 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:16:13: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration] 16 | a = atoi(s1); | ^~~~ main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%s%s", s1, s2); | ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char s1[6], s2[6]; int a, b; int s1_len, s2_len; char s_a[6], s_b[6]; scanf("%s%s", s1, s2); //if(s1[0] == '0' || s2[0] == '0'){ // printf("NG\n"); // return 0; //} s1_len = strlen(s1); s2_len = strlen(s2); a = atoi(s1); b = atoi(s2); sprintf(s_a, "%d", a); sprintf(s_b, "%d", b); if(strlen(s_a) != s1_len || strlen(s_b) != s2_len){ printf("NG\n"); return 0; } if(a < 0 || a > 12345 || b < 0 || b > 12345){ printf("NG\n"); return 0; } printf("OK\n"); return 0; }