結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2016-03-23 14:20:36 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 21:25:19 |
合計ジャッジ時間 | 781 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 10 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:14:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d",&N); | ^~~~~~~~~~~~~~ main.c:18:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%d%d%d%d",&A,&B,&C,&D); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:19:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%s",R); | ^~~~~~~~~~~~~
ソースコード
#include<stdio.h>#include<string.h>int main(void){int i,j,N;int A,B,C,D;int Number[10];char R[3];for(i=0;i<10;i++)Number[i]=1;scanf("%d",&N);for(i=0;i<N;i++){scanf("%d%d%d%d",&A,&B,&C,&D);scanf("%s",R);printf("%d%d%d%d %s\n",A,B,C,D,R);if(strcmp(R,"NO")==0){Number[A]=0;Number[B]=0;Number[C]=0;Number[D]=0;}else if(strcmp(R,"YES")==0){//A,B,C,Dの中のどれか1つが答え→それ以外は候補から外れる=0for(j=0;j<10;j++){if((j!=A) && (j!=B) && (j!=C) && (j!=D))Number[j]=0;}}}for(i=0;i<10;i++){if(Number[i]==1)printf("%d",i);}return 0;}