結果

問題 No.431 死亡フラグ
コンテスト
ユーザー issekiamp
提出日時 2016-12-18 13:38:07
言語 C90
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 313 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 166 ms
コンパイル使用メモリ 35,508 KB
最終ジャッジ日時 2026-02-23 23:51:47
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:7:9: warning: 'gets' is deprecated [-Wdeprecated-declarations]
    7 |         gets(data);
      |         ^~~~
In file included from main.c:1:
/usr/include/stdio.h:667:14: note: declared here
  667 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
/usr/bin/ld: /tmp/ccza4cPs.o: in function `main':
main.c:(.text.startup+0x1a): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#include <stdio.h>

int main(void) {
	char data[10] = {0};
	int sibou = 0;

	gets(data);
	
	if(data[0] == '1') {
		sibou++;
	}

	if(data[2] == '1') {
		sibou++;
	}

	if(data[4] == '1') {
		sibou++;
	}

	if ((sibou < 2) || (data[6] == '1')) {
		printf("SURVIVED\n");
	} else {
		printf("DEAD\n");
	}
	
	return 0;
}
0