結果

問題 No.289 数字を全て足そう
ユーザー SojiroNishimuraSojiroNishimura
提出日時 2018-03-21 10:51:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 1,000 ms
コード長 331 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 103,912 KB
実行使用メモリ 22,928 KB
最終ジャッジ日時 2023-09-07 00:49:37
合計ジャッジ時間 4,815 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
20,828 KB
testcase_01 AC 54 ms
20,936 KB
testcase_02 AC 55 ms
22,928 KB
testcase_03 AC 53 ms
20,720 KB
testcase_04 AC 55 ms
22,832 KB
testcase_05 AC 55 ms
21,008 KB
testcase_06 AC 54 ms
20,896 KB
testcase_07 AC 54 ms
18,956 KB
testcase_08 AC 55 ms
22,832 KB
testcase_09 AC 54 ms
22,856 KB
testcase_10 AC 54 ms
22,924 KB
testcase_11 AC 54 ms
20,884 KB
testcase_12 AC 55 ms
20,980 KB
testcase_13 AC 54 ms
20,824 KB
testcase_14 AC 55 ms
20,888 KB
testcase_15 AC 53 ms
18,740 KB
testcase_16 AC 54 ms
20,820 KB
testcase_17 AC 54 ms
20,932 KB
testcase_18 AC 55 ms
20,988 KB
testcase_19 AC 54 ms
20,864 KB
testcase_20 AC 54 ms
20,720 KB
testcase_21 AC 53 ms
20,900 KB
testcase_22 AC 53 ms
20,988 KB
testcase_23 AC 55 ms
22,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class Problem
{
    public static void Main(string[] args)
    {
        var line = Console.ReadLine();
        var ans = 0;
        foreach (var c in line)
        {
            if (c >= '0' && c <= '9') ans += (int) Char.GetNumericValue(c);
        }
        Console.WriteLine($"{ans}");
    }
}
0