結果

問題 No.289 数字を全て足そう
ユーザー mbanmban
提出日時 2016-11-04 15:39:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 1,000 ms
コード長 534 bytes
コンパイル時間 2,122 ms
コンパイル使用メモリ 99,976 KB
実行使用メモリ 24,908 KB
最終ジャッジ日時 2023-08-16 13:46:15
合計ジャッジ時間 5,019 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
22,760 KB
testcase_01 AC 53 ms
20,696 KB
testcase_02 AC 52 ms
20,700 KB
testcase_03 AC 50 ms
20,472 KB
testcase_04 AC 49 ms
20,592 KB
testcase_05 AC 55 ms
22,716 KB
testcase_06 AC 55 ms
22,720 KB
testcase_07 AC 60 ms
22,824 KB
testcase_08 AC 60 ms
22,672 KB
testcase_09 AC 54 ms
20,584 KB
testcase_10 AC 56 ms
22,744 KB
testcase_11 AC 59 ms
22,796 KB
testcase_12 AC 62 ms
20,704 KB
testcase_13 AC 57 ms
22,788 KB
testcase_14 AC 61 ms
22,736 KB
testcase_15 AC 59 ms
24,864 KB
testcase_16 AC 57 ms
20,808 KB
testcase_17 AC 59 ms
22,832 KB
testcase_18 AC 61 ms
24,908 KB
testcase_19 AC 59 ms
22,816 KB
testcase_20 AC 59 ms
22,780 KB
testcase_21 AC 53 ms
22,700 KB
testcase_22 AC 62 ms
24,828 KB
testcase_23 AC 64 ms
24,812 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.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Magatro
{
    static void Main()
    {
        string S = Console.ReadLine();
        int cnt = 0;
        for(int i = 0; i < S.Length; i++)
        {
            for(int j = 1;j <= 9; j++)
            {
                if (S[i].ToString() == j.ToString())
                {
                    cnt += int.Parse(S[i].ToString());
                }
            }
        }
        Console.WriteLine(cnt);
    }
}
0