結果

問題 No.431 死亡フラグ
ユーザー vis
提出日時 2016-12-26 14:30:04
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 23:46:16
合計ジャッジ時間 736 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 %d %d %d", &d1, &d2, &d3, &s);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	int cnt = 0;
	int d1, d2, d3, s;
	scanf("%d %d %d %d", &d1, &d2, &d3, &s);
		
	if (d1 == 1) cnt++;
	if (d2 == 1) cnt++;
	if (d3 == 1) cnt++;
	
	if (cnt >= 2 && s == 0) {
		printf("DEAD\n");
	} else {
		printf("SURVIVED\n");
	}
}
0