結果
| 問題 |
No.516 赤と青の風船
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-19 22:37:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 385 bytes |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 22,144 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 18:44:37 |
| 合計ジャッジ時間 | 893 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s",S1);
| ~~~~~^~~~~~~~~
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",S2);
| ~~~~~^~~~~~~~~
main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s",S3);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
//input
char S1[5];
char S2[5];
char S3[5];
scanf("%s",S1);
scanf("%s",S2);
scanf("%s",S3);
//count
int red = 0;
if (S1[0] == 'R') red++;
if (S2[0] == 'R') red++;
if (S3[0] == 'R') red++;
//output
if (red >= 2){
printf("RED\n");
}else{
printf("BLUE\n");
}
return 0;
}