結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー naimonon77
提出日時 2015-09-25 20:23:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 67,292 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-19 09:15:57
合計ジャッジ時間 1,531 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:31:16: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘long double’ [-Wformat=]
   31 |    printf("%.10f\n",sum);
      |            ~~~~^    ~~~
      |                |    |
      |                |    long double
      |                double
      |            %.10Lf

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
using namespace std;


#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double lb;
/* ここからが本編 */

int main(void)
{
   ull i,j,k;
   ull n;
   long double a;
   long double sum = 0;
   cin >> n;
   for(i=0;i<n;i++) {
      cin >> a;
      sum += a;
   }
   printf("%.10f\n",sum);

   return 0;
}
0