結果
| 問題 |
No.516 赤と青の風船
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-28 21:22:33 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 324 bytes |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 20,224 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-21 15:15:22 |
| 合計ジャッジ時間 | 737 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 |
コンパイルメッセージ
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);
| ^~~~~~~~~~~~~
ソースコード
#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;
}