結果

問題 No.289 数字を全て足そう
ユーザー shinjiwebshinjiweb
提出日時 2019-05-15 23:44:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 1,000 ms
コード長 414 bytes
コンパイル時間 2,442 ms
コンパイル使用メモリ 64,640 KB
実行使用メモリ 22,708 KB
最終ジャッジ日時 2023-10-12 18:27:16
合計ジャッジ時間 4,622 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
22,652 KB
testcase_01 AC 54 ms
22,640 KB
testcase_02 AC 54 ms
20,604 KB
testcase_03 AC 54 ms
20,588 KB
testcase_04 AC 55 ms
20,656 KB
testcase_05 AC 54 ms
20,608 KB
testcase_06 AC 54 ms
20,532 KB
testcase_07 AC 56 ms
20,724 KB
testcase_08 AC 56 ms
20,736 KB
testcase_09 AC 56 ms
20,776 KB
testcase_10 AC 55 ms
20,608 KB
testcase_11 AC 56 ms
20,656 KB
testcase_12 AC 55 ms
20,548 KB
testcase_13 AC 55 ms
20,648 KB
testcase_14 AC 56 ms
20,712 KB
testcase_15 AC 55 ms
20,600 KB
testcase_16 AC 55 ms
22,708 KB
testcase_17 AC 56 ms
20,676 KB
testcase_18 AC 56 ms
20,800 KB
testcase_19 AC 55 ms
20,604 KB
testcase_20 AC 55 ms
20,632 KB
testcase_21 AC 55 ms
20,612 KB
testcase_22 AC 56 ms
20,608 KB
testcase_23 AC 56 ms
20,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            string line = Console.ReadLine();
            int sum = 0;
            foreach (var c in line)
            {
                if (int.TryParse(c.ToString(), out int num))
                {
                    sum += num;
                }
            }
            Console.WriteLine(sum);
        }
    }
}
0