結果

問題 No.24 数当てゲーム
ユーザー tsukacchantsukacchan
提出日時 2016-03-23 14:21:37
言語 C90
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 619 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 21:00:03
合計ジャッジ時間 568 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,812 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 0 ms
6,944 KB
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      | ^~~~~~~~~~~~~

ソースコード

diff #

#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つが答え→それ以外は候補から外れる=0
		for(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;

}
0