結果
| 問題 | No.394 ハーフパイプ(1) |
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2016-10-01 16:22:38 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 321 bytes |
| 記録 | |
| コンパイル時間 | 501 ms |
| コンパイル使用メモリ | 21,248 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-21 12:48:43 |
| 合計ジャッジ時間 | 717 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:26:8: warning: too many arguments for format [-Wformat-extra-args]
26 | printf(".2f",dc);
| ^~~~~
main.c:12:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&s[i]);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main()
{
int s[6];
int i;
int d;
int c;
int p;
double dc;
for(i=0;i<6;i++){
scanf("%d",&s[i]);
}
for(i=0;i<6;i++){
for(d=5;d>i;d--){
if(s[d-1]>s[d]){
c=s[d];
s[d]=s[d-1];
s[d-1]=c;
}
}
}
dc=(double)(s[1]+s[2]+s[3]+s[4])/4;
printf(".2f",dc);
return 0;
}
Haijinn