結果

問題 No.975 ミスターマックスバリュ
ユーザー sasa
提出日時 2025-03-17 17:56:21
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 754 ms
コンパイル使用メモリ 25,088 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-17 17:56:22
合計ジャッジ時間 1,407 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 8 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |         scanf("%d%d%d",&wanted, &element1, &element2);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%d",&product1[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
main.c:16:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |                 scanf("%d",&product2[j]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
	int wanted, element1, element2;
	scanf("%d%d%d",&wanted, &element1, &element2);
	char *ans = "-1";
	
	int product1[element1];
	for(int i = 0;i < element1;i ++){
		scanf("%d",&product1[i]);
		if(wanted == product1[i]){
			ans = "MrMax";
		}
	}
	int product2[element2];
	for(int j = 0;j < element2;j ++){
		scanf("%d",&product2[j]);
		if(wanted == product2[j]){
			if(ans = "MrMax"){
				ans = "MrMaxValu";
			}else{
				ans = "MaxValu";
			}
		}
	}
	printf("%s",ans);
}
0