結果

問題 No.289 数字を全て足そう
ユーザー taka_ltdtaka_ltd
提出日時 2020-06-09 21:15:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 1,000 ms
コード長 666 bytes
コンパイル時間 2,948 ms
コンパイル使用メモリ 102,256 KB
実行使用メモリ 26,716 KB
最終ジャッジ日時 2023-08-30 22:00:49
合計ジャッジ時間 5,249 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
20,584 KB
testcase_01 AC 54 ms
22,676 KB
testcase_02 AC 53 ms
20,704 KB
testcase_03 AC 50 ms
20,556 KB
testcase_04 AC 54 ms
20,652 KB
testcase_05 AC 57 ms
22,748 KB
testcase_06 AC 55 ms
20,696 KB
testcase_07 AC 62 ms
24,932 KB
testcase_08 AC 61 ms
24,788 KB
testcase_09 AC 55 ms
20,800 KB
testcase_10 AC 57 ms
20,836 KB
testcase_11 AC 60 ms
22,628 KB
testcase_12 AC 65 ms
26,716 KB
testcase_13 AC 59 ms
24,744 KB
testcase_14 AC 63 ms
24,860 KB
testcase_15 AC 60 ms
22,608 KB
testcase_16 AC 58 ms
22,724 KB
testcase_17 AC 60 ms
24,716 KB
testcase_18 AC 63 ms
24,936 KB
testcase_19 AC 59 ms
22,712 KB
testcase_20 AC 61 ms
24,748 KB
testcase_21 AC 53 ms
20,620 KB
testcase_22 AC 63 ms
24,760 KB
testcase_23 AC 65 ms
24,876 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.Collections.Concurrent;
using System.ComponentModel;

namespace yukicoder3
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int ans = 0;
            for (int A = 0; A < input.Length; A++)
            {
                for (int B = 0; B <= 9; B++)
                {
                    if (input[A].ToString() == B.ToString())
                    {
                        ans += int.Parse(input[A].ToString());
                    }               
                }
            }

            Console.WriteLine(ans);
            





        }
    }
}
0