結果
問題 | No.516 赤と青の風船 |
ユーザー |
![]() |
提出日時 | 2017-06-23 17:50:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 312 bytes |
コンパイル時間 | 470 ms |
コンパイル使用メモリ | 54,708 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-03 04:13:07 |
合計ジャッジ時間 | 854 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:13:11: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 13 | b="BLUE"; | ^~~~~~
ソースコード
#include<stdio.h> #include <iostream> #include <cstring> using namespace std; int main(){ char a1[10],a2[10],a3[10]; cin>>a1>>a2>>a3; char *b; b="BLUE"; int i=0; if(!strcmp(a1,b)) i++; if(!strcmp(a2,b)) i++; if(!strcmp(a3,b)) i++; if(i>1) printf("BLUE\n"); else printf("RED\n"); return 0; }