結果
| 問題 |
No.431 死亡フラグ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-20 11:47:27 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 517 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-23 14:39:15 |
| 合計ジャッジ時間 | 741 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d,%d,%d,%d",&D1,&D2,&D3,&D4);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
int D1 ,D2,D3,D4, count = 0;
scanf("%d,%d,%d,%d",&D1,&D2,&D3,&D4);
if(D1 == 0){
count = count + 1;
}
if(D2 == 0){
count = count + 1;
}
if(D3 == 0){
count = count + 1;
}
if(D4 == 0){
count = count + 1;
}
if(D1 == 1 ||D2 == 1 || D3 == 1 || D4 ==1){
printf("SURVIVED\n");
}else if(count >=2){
printf("DEAD\n");
}
else{
printf("SURVIVED\n");
}
return 0;
}