結果
| 問題 |
No.88 次はどっちだ
|
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2015-01-13 23:04:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 447 bytes |
| コンパイル時間 | 121 ms |
| コンパイル使用メモリ | 23,296 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-22 05:20:32 |
| 合計ジャッジ時間 | 875 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s", S);
| ~~~~~^~~~~~~~~
main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%s", s);
| ~~~~~^~~~~~~~~
ソースコード
#include <cstdio>
#include <cstring>
char name[2][10] = {"oda", "yukiko"};
int main(){
char S[10];
scanf("%s", S);
int first;
if(strcmp(S, name[0]) == 0){first = 0;}
else{first = 1;}
int n = 0;
for(int i=0;i<8;i++){
char s[10];
scanf("%s", s);
for(int j=0;j<8;j++){
if(s[j] != '.'){n += 1;}
}
}
if(n % 2 == 0){puts(name[first]);}
else{puts(name[!first]);}
}
tottoripaper