結果

問題 No.24 数当てゲーム
ユーザー tsukacchantsukacchan
提出日時 2016-03-23 13:18:53
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 20,992 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 19:19:31
合計ジャッジ時間 775 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
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,N;
int A,B,C,D;
int Number[10];
char R[3];

for(i=0;i<10;i++)
Number[i]=0;

scanf("%d",&N);

for(i=0;i<N;i++){

scanf("%d%d%d%d",&A,&B,&C,&D);
scanf("%s",R);

	if(strcmp(R,"YES")==0){
	Number[A]++;
	Number[B]++;
	Number[C]++;
	Number[D]++;
	}
	
	else if(strcmp(R,"NO")==0){
	Number[A]=0;
	Number[B]=0;
	Number[C]=0;
	Number[D]=0;
	}


}

for(i=0;i<10;i++){
if(Number[i]==2)
printf("%d",i);

}

return 0;

}
0