結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-09 01:50:00 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 452 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 29,896 KB |
| 最終ジャッジ日時 | 2026-02-23 22:48:31 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d%d%d",&q[0],&q[1],&q[2],&q[3]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",res);
| ^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(){
int n,q[4],a[10]={1,1,1,1,1,1,1,1,1,1},i,j,k;
char res[5];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d%d%d",&q[0],&q[1],&q[2],&q[3]);
scanf("%s",res);
for(j=0;j<10;j++){
for(k=0;k<4;k++){
if(res[0]=='Y'){
if(q[k]!=j){
a[j]=0;
}
}else{
if(q[k]==j){
a[j]=0;
}
}
}
}
}
for(j=0;j<10;j++){
if(a[j]==1)printf("%d",j);
}
return 0;
}