結果

問題 No.21 平均の差
ユーザー tarotaro789tarotaro789
提出日時 2017-03-06 01:42:39
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 28,464 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-05 10:21:50
合計ジャッジ時間 1,870 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void)
{
	int i,a,b,mx,mi;
	scanf("%d",&a);
	rewind(stdin);
	scanf("%d",&b);
	rewind(stdin);
	int c[a];
	for(i=0;i<a;i++){
		scanf("%d",c+i);
		rewind(stdin);
	}
	mx=c[0];
	mi=c[0];
	for(i=0;i<a;i++){
		if(mx<c[i]){
			mx=c[i];
		}
		if(mi>c[i]){
			mi=c[i];
		}
	}
	printf("%d\n",mx-mi);
	return 0;
}
0