結果

問題 No.201 yukicoderじゃんけん
ユーザー suppy193
提出日時 2015-05-27 11:31:34
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 270 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 10:37:20
合計ジャッジ時間 972 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%s%d%c", sa, &pa, &xa);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%s%d%c", sb, &pb, &xb);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void)
{
	char sa[101], sb[101];
	int pa, pb;
	char xa, xb; 
	scanf("%s%d%c", sa, &pa, &xa);
	getchar();
	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;
}
0