結果

問題 No.394 ハーフパイプ(1)
ユーザー exteloextelo
提出日時 2016-07-21 20:51:10
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 627 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 00:57:06
合計ジャッジ時間 822 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 0 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#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;
}
0