結果

問題 No.289 数字を全て足そう
ユーザー p_nix
提出日時 2018-01-23 20:41:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 445 bytes
コンパイル時間 913 ms
コンパイル使用メモリ 111,868 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-12-26 03:45:10
合計ジャッジ時間 2,358 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace prob289
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] a = Console.ReadLine().ToCharArray();
            int r = 0;
            int b = 0; ;
            foreach (var i in a)
            {
                if (int.TryParse(i.ToString(),out b))
                {
                    r += b;
                }
            }
            Console.WriteLine(r);
        }
    }
}
0