結果
問題 |
No.516 赤と青の風船
|
ユーザー |
![]() |
提出日時 | 2017-06-23 17:49:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 312 bytes |
コンパイル時間 | 403 ms |
コンパイル使用メモリ | 54,528 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-03 04:13:06 |
合計ジャッジ時間 | 858 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 2 |
コンパイルメッセージ
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(a2,b)) i++; if(i>1) printf("BLUE\n"); else printf("RED\n"); return 0; }