結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー bayashiko_rbayashiko_r
提出日時 2018-10-29 22:41:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 183 ms / 3,000 ms
コード長 501 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 103,040 KB
実行使用メモリ 36,864 KB
最終ジャッジ日時 2024-04-29 23:54:42
合計ジャッジ時間 3,251 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
17,536 KB
testcase_01 AC 21 ms
17,536 KB
testcase_02 AC 22 ms
17,664 KB
testcase_03 AC 22 ms
17,408 KB
testcase_04 AC 21 ms
17,280 KB
testcase_05 AC 21 ms
17,664 KB
testcase_06 AC 23 ms
17,664 KB
testcase_07 AC 28 ms
18,140 KB
testcase_08 AC 46 ms
20,304 KB
testcase_09 AC 69 ms
26,240 KB
testcase_10 AC 159 ms
35,328 KB
testcase_11 AC 163 ms
35,456 KB
testcase_12 AC 166 ms
35,456 KB
testcase_13 AC 171 ms
35,968 KB
testcase_14 AC 168 ms
35,968 KB
testcase_15 AC 171 ms
35,840 KB
testcase_16 AC 183 ms
36,864 KB
testcase_17 AC 22 ms
17,536 KB
testcase_18 AC 22 ms
17,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
class Program {
    static void Main(string[] args) {
        //数字の入力
        int N = int.Parse(Console.ReadLine());
        string[] s = new string[N];
        long[] num = new long[N];
        
        //数字の割り当て&和を求める
        long sum = 0;
        for (int i = 0; i < N; i++) {
            s[i] = Console.ReadLine();
            num[i] = long.Parse(s[i]);
            sum += num[i];
        }

        //出力
        Console.WriteLine(sum);
    }
}
0