結果

問題 No.394 ハーフパイプ(1)
ユーザー focus
提出日時 2018-01-17 18:54:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 763 ms
コンパイル使用メモリ 66,108 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-24 06:50:06
合計ジャッジ時間 1,067 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:16: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘int’ [-Wformat=]
   19 |     printf("%.2f",sum/4);
      |             ~~~^  ~~~~~
      |                |     |
      |                |     int
      |                double
      |             %.2d

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    int x;
    vector<int> num;
    for(int i=0;i<6;i++){
        cin >> x;
        num.push_back(x);
    }
    sort(num.begin(),num.end());
    int sum=0;
    for(int i=1;i<5;i++){
        sum+=num[i];
    }
    printf("%.2f",sum/4);
    return 0;
}
0