結果
| 問題 |
No.394 ハーフパイプ(1)
|
| コンテスト | |
| ユーザー |
extelo
|
| 提出日時 | 2016-07-21 20:51:10 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 627 bytes |
| コンパイル時間 | 965 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 07:31:46 |
| 合計ジャッジ時間 | 733 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:25:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
25 | scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void sort(int ten[])
{
int i,j,temp;
for(i=0;i<6;i++){
for(j=5;j<i;j--){
if(ten[i] > ten[j]){
temp = ten[i];
ten[i] = ten[j];
ten[j] = temp;
}
}
}
}
int main(void)
{
int a,b,c,d,e,f;
int ten[6];
double ans;
scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
// scanf("%d", &b);
// scanf("%d", &c);
// scanf("%d", &d);
//scanf("%d", &e);
//scanf("%d", &f);
ten[0] = a;
ten[1] = b;
ten[2] = c;
ten[3] = d;
ten[4] = e;
ten[5] = f;
sort(ten);
ans = (double)(ten[1]+ten[2]+ten[3]+ten[4])/4.0;
printf("%.2f\n", ans);
return 0;
}
extelo