結果
| 問題 |
No.21 平均の差
|
| ユーザー |
Yang33
|
| 提出日時 | 2015-12-28 00:17:54 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 285 bytes |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 20,224 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 07:33:31 |
| 合計ジャッジ時間 | 670 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
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]);
| ^~~~~~~~~~~~~~~~~~~
ソースコード
#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;
}
Yang33