結果

問題 No.431 死亡フラグ
ユーザー lonly
提出日時 2016-10-20 11:44:56
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 14:39:14
合計ジャッジ時間 783 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#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");
    }else if(count >=2){
    	printf("DEAD");
    	
    }
    else{
    	printf("SURVIVED");
    	
    }
    
    
    
	return 0;
}
0