結果

問題 No.201 yukicoderじゃんけん
ユーザー suppy193
提出日時 2015-06-03 11:11:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 22,016 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 13:52:50
合計ジャッジ時間 735 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%s%lld%s", Sa, &Pa, Xa);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s%lld%s", Sb, &Pb, Xb);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	char Sa[101], Sb[101], Xa[2], Xb[2];
	long long int Pa, Pb;
	scanf("%s%lld%s", Sa, &Pa, Xa);
	scanf("%s%lld%s", Sb, &Pb, Xb);
//	printf("%s %lld %s\n", Sa, 99999999999999999999LL, Xa);
//	printf("%s %lld %s\n", Sb, Pb, Xb);
	if(Pa > Pb)printf("%s\n", Sa);
	else if(Pa < Pb)printf("%s\n", Sb);
	else printf("-1\n");

    return 0;
}
0