結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー hogeover30
提出日時 2015-02-09 02:13:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 24,320 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 11:31:10
合計ジャッジ時間 1,203 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:23: warning: use of ‘ll’ length modifier with ‘f’ type character has either no effect or undefined behavior [-Wformat=]
    9 |             scanf("%llf", &a);
      |                       ^
main.cpp:12:23: warning: use of ‘ll’ length modifier with ‘f’ type character has either no effect or undefined behavior [-Wformat=]
   12 |         printf("%.10llf\n", res);
      |                       ^
main.cpp:9:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |             scanf("%llf", &a);
      |             ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
int main()
{
    int n;
    while (~scanf("%d", &n)) {
        long double res=0;
        while (n--) {
            long double a;
            scanf("%llf", &a);
            res+=a;
        }
        printf("%.10llf\n", res);
    }
}
0