結果

問題 No.21 平均の差
ユーザー Yang33Yang33
提出日時 2015-12-28 00:17:54
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 20,484 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 11:25:36
合計ジャッジ時間 1,503 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 0 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 0 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d %d", &n, &k);//無しでもいけそう
      |         ^~~~~~~~~~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 scanf("%d", &pa[i]);
      |                 ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main(void)
{
	int i, n, k, min = 1001, max = 0, pa[10];
	scanf("%d %d", &n, &k);//無しでもいけそう
	for (i = 0; i < n; i++) {
		scanf("%d", &pa[i]);
		if (min > pa[i])min = pa[i];
		if (max < pa[i])max = pa[i];
	}
	printf("%d\n", max - min);
	return 0;
}
0