結果
| 問題 | 
                            No.394 ハーフパイプ(1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             extelo
                         | 
                    
| 提出日時 | 2016-08-18 20:53:43 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 696 bytes | 
| コンパイル時間 | 1,030 ms | 
| コンパイル使用メモリ | 21,248 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-07 19:32:17 | 
| 合計ジャッジ時間 | 1,360 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 11 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:26:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   26 |   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;
  int i;
  
  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);
  
  for(i=0;i<6;i++){
    printf("%d\n", ten[i]);
  }
  ans = (double)(ten[1]+ten[2]+ten[3]+ten[4])/4.0;
  printf("%.2f\n", ans);
  return 0;
}
            
            
            
        
            
extelo