結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー ingredientingredient
提出日時 2019-07-08 09:36:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 54,640 KB
実行使用メモリ 7,680 KB
最終ジャッジ日時 2024-04-16 19:44:15
合計ジャッジ時間 2,105 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,424 KB
testcase_01 AC 4 ms
7,552 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 103 ms
7,552 KB
testcase_11 AC 106 ms
7,552 KB
testcase_12 AC 106 ms
7,552 KB
testcase_13 AC 109 ms
7,680 KB
testcase_14 AC 111 ms
7,680 KB
testcase_15 AC 115 ms
7,552 KB
testcase_16 AC 128 ms
7,424 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:12: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |         sum=sum+A[i];
      |         ~~~^~~~~~~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
    int N;
    cin >> N;
    double A[500000];
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    double sum;
    for(int i=0;i<N;i++){
        sum=sum+A[i];
    }
    cout << sum << endl;
    return 0;
}
0