結果

問題 No.289 数字を全て足そう
ユーザー zmirezzmirez
提出日時 2018-05-15 13:40:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 104 ms / 1,000 ms
コード長 410 bytes
コンパイル時間 2,612 ms
コンパイル使用メモリ 101,840 KB
実行使用メモリ 24,756 KB
最終ジャッジ日時 2023-09-10 21:00:36
合計ジャッジ時間 6,220 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,668 KB
testcase_01 AC 54 ms
20,672 KB
testcase_02 AC 56 ms
20,688 KB
testcase_03 AC 56 ms
20,792 KB
testcase_04 AC 55 ms
22,664 KB
testcase_05 AC 67 ms
20,792 KB
testcase_06 AC 63 ms
20,676 KB
testcase_07 AC 94 ms
22,792 KB
testcase_08 AC 93 ms
22,640 KB
testcase_09 AC 67 ms
20,688 KB
testcase_10 AC 73 ms
22,624 KB
testcase_11 AC 88 ms
22,708 KB
testcase_12 AC 102 ms
22,716 KB
testcase_13 AC 81 ms
20,640 KB
testcase_14 AC 104 ms
22,600 KB
testcase_15 AC 89 ms
20,608 KB
testcase_16 AC 79 ms
22,724 KB
testcase_17 AC 91 ms
20,664 KB
testcase_18 AC 103 ms
24,756 KB
testcase_19 AC 89 ms
20,676 KB
testcase_20 AC 92 ms
20,772 KB
testcase_21 AC 55 ms
20,804 KB
testcase_22 AC 100 ms
20,764 KB
testcase_23 AC 58 ms
20,676 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){
        string S=Console.ReadLine();
        // string str = "abcde";
        // Console.WriteLine(str[3]);
        int sum = 0;
        for(int i = 0; i < S.Length;i++){
            try {
                sum += int.Parse(Char.ToString(S[i]));
            } catch {
            }
        }
        Console.WriteLine(sum);
    }
}
0