結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2015-11-23 18:59:11 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 601 bytes |
コンパイル時間 | 487 ms |
コンパイル使用メモリ | 21,632 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 17:17:06 |
合計ジャッジ時間 | 733 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:10:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d", &n); | ^~~~~~~~~~~~~~~ main.c:13:24: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | for(j=0; j<4; ++j) scanf("%d", &input[j]); | ^~~~~~~~~~~~~~~~~~~~~~ main.c:14:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf(" %c%*s", &r); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>int main(){int num[10]={1,1,1,1,1,1,1,1,1,1};int marker[10]={0};int n, input[4];char r;int i, j;scanf("%d", &n);for(i=0; i<n; ++i){for(j=0; j<10; ++j) marker[j]=0;for(j=0; j<4; ++j) scanf("%d", &input[j]);scanf(" %c%*s", &r);switch(r){case 'Y':for(j=0; j< 4; ++j) marker[input[j]]=1;for(j=0; j<10; ++j) num[j]*=marker[j];break;case 'N':for(j=0; j< 4; ++j) num[input[j]]=0;break;}}for(i=0; i<10; ++i){if(num[i]==1){printf("%d\n", i);break;}}return 0;}