結果
問題 |
No.24 数当てゲーム
|
ユーザー |
![]() |
提出日時 | 2025-03-07 14:05:28 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 576 bytes |
コンパイル時間 | 573 ms |
コンパイル使用メモリ | 25,600 KB |
実行使用メモリ | 8,612 KB |
最終ジャッジ日時 | 2025-03-07 14:05:29 |
合計ジャッジ時間 | 1,306 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 8 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:17:20: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration] 17 | if(strcmp(judge,"YES") != 0){ | ^~~~~~ main.c:2:1: note: include ‘<string.h>’ or provide a declaration of ‘strcmp’ 1 | #include <stdio.h> +++ |+#include <string.h> 2 |
ソースコード
#include <stdio.h> void main(void){ //調べる数字は0~9の間の数字。 int turn = 0; int input = scanf("%d\n",&turn); int targetNumber = 0; int pickUp[4]; int numericList[10] = {0}; for(int i = 0 ; i < turn ; i++ ){ for(int j = 0 ; j < 4 ; j++ ){ input = scanf("%d",&pickUp[j]); } char judge[10] = "a"; input = scanf("%s",judge); if(strcmp(judge,"YES") != 0){ continue; } for(int j = 0 ; j < 4 ; j++ ){ numericList[pickUp[j]]++; } } for(int i = 0 ; i < 10 ; i++){ if(numericList[i] == 2){ printf("%d\n",i); break; } } }