結果

問題 No.516 赤と青の風船
ユーザー YamyukiYamyuki
提出日時 2017-05-28 21:22:33
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 20,328 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 14:01:10
合計ジャッジ時間 792 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 0 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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("%s",s);
      |         ^~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%s",s);
      |         ^~~~~~~~~~~~~
main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |         scanf("%s",s);
      |         ^~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main(int argc, char const *argv[]){
	char s[5];
	int a=0,b=0;
	scanf("%s",s);
	if(s[0]=='R') a++;
	else b++;
	getchar();
	scanf("%s",s);
	if(s[0]=='R') a++;
	else b++;
	getchar();
	scanf("%s",s);
	if(s[0]=='R') a++;
	else b++;
	getchar();
	if(a>b) printf("RED\n");
	else printf("BLUE\n");
	return 0;
}
0