結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
hum_op
|
| 提出日時 | 2015-05-06 10:45:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 280 bytes |
| コンパイル時間 | 141 ms |
| コンパイル使用メモリ | 22,912 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 19:16:00 |
| 合計ジャッジ時間 | 825 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:20: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long unsigned int*’ [-Wformat=]
8 | scanf("%s %d %c", SA, &PA, &XA);
| ~^ ~~~
| | |
| int* long long unsigned int*
| %lld
main.cpp:9:20: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long unsigned int*’ [-Wformat=]
9 | scanf("%s %d %c", SB, &PB, &XB);
| ~^ ~~~
| | |
| int* long long unsigned int*
| %lld
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s %d %c", SA, &PA, &XA);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s %d %c", SB, &PB, &XB);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
int main(){
char SA[100], SB[100];
char XA, XB;
unsigned long long int PA, PB;
scanf("%s %d %c", SA, &PA, &XA);
scanf("%s %d %c", SB, &PB, &XB);
if (PA > PB) printf("%s\n", SA);
else if (PA < PB) printf("%s\n", SB);
else printf("-1\n");
return 0;
}
hum_op