結果

問題 No.21 平均の差
ユーザー tarotaro789tarotaro789
提出日時 2017-03-06 01:44:48
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 1,260 ms
コンパイル使用メモリ 24,372 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 10:21:53
合計ジャッジ時間 1,844 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,380 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