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