結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
A63295
|
| 提出日時 | 2015-12-18 00:04:25 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 418 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-16 07:49:51 |
| 合計ジャッジ時間 | 2,190 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:21: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
8 | scanf ( "%d", n[i]);
| ~^ ~~~~
| | |
| | int
| int *
main.c:6:6: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf ( "%d%d", &N, &K);
| ^~~~~~~~~~~~~~~~~~~~~~~
main.c:8:11: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf ( "%d", n[i]);
| ^~~~~~~~~~~~~~~~~~~
ソースコード
# include <stdio.h>
int main(void){
int i , max, min, N, K, n[11];
max = 0;
min = 0;
scanf ( "%d%d", &N, &K);
for ( i = 0; i < N; i++){
scanf ( "%d", n[i]);
}
for( i = 0; i < N; i++){
if ( max < n[i])
max = n[i];
if (min > n[i])
min = n[i];
}
printf("%d",max -min);
return 0;
}
A63295