結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-12-04 20:14:47 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 385 bytes | 
| コンパイル時間 | 170 ms | 
| コンパイル使用メモリ | 21,120 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-27 19:45:26 | 
| 合計ジャッジ時間 | 727 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%d%d%d%d%s",&a,&b,&c,&d,s);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(void){
	int a,b,c,d,n,i,j,k[16]={0};
	char s[4];
	scanf("%d",&n);
	for(i = 1;i <= n;i++){
		scanf("%d%d%d%d%s",&a,&b,&c,&d,s);
		for(j = 0;j <= 9;j++){
			if(j == a || j == b || j == c || j == d){
				if(s[0] == 'N'){k[j] = 1;}
			}
			else{
				if(s[0] == 'Y'){k[j] = 1;}
			}
		}
	}
	for(i = 0;i <= 9;i++){
		if(!(k[i])){printf("%d\n",i);}
	}
	return 0;
}
            
            
            
        