結果

問題 No.289 数字を全て足そう
ユーザー cccccc
提出日時 2022-07-19 19:38:15
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 365 bytes
コンパイル時間 12,757 ms
コンパイル使用メモリ 146,196 KB
実行使用メモリ 162,184 KB
最終ジャッジ日時 2023-09-14 15:58:41
合計ジャッジ時間 15,062 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
26,260 KB
testcase_01 AC 45 ms
26,280 KB
testcase_02 AC 44 ms
26,536 KB
testcase_03 AC 45 ms
26,588 KB
testcase_04 AC 45 ms
26,432 KB
testcase_05 AC 44 ms
26,492 KB
testcase_06 AC 44 ms
26,256 KB
testcase_07 AC 46 ms
28,228 KB
testcase_08 AC 46 ms
26,628 KB
testcase_09 AC 45 ms
26,340 KB
testcase_10 AC 45 ms
26,272 KB
testcase_11 AC 45 ms
28,604 KB
testcase_12 AC 46 ms
26,580 KB
testcase_13 AC 45 ms
26,524 KB
testcase_14 AC 44 ms
26,308 KB
testcase_15 AC 44 ms
26,296 KB
testcase_16 AC 45 ms
26,220 KB
testcase_17 AC 45 ms
28,308 KB
testcase_18 AC 46 ms
28,352 KB
testcase_19 AC 45 ms
26,540 KB
testcase_20 AC 45 ms
26,412 KB
testcase_21 AC 45 ms
26,252 KB
testcase_22 AC 45 ms
28,376 KB
testcase_23 AC 45 ms
162,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 128 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        var inp = Console.ReadLine();
        int ans = 0;
        foreach (var c in inp)
        {
            int i = (int)Char.GetNumericValue(c);
            if(i >= 0 && i <= 9)
            {
                ans += i;
            }
        }
        Console.WriteLine(ans);
    }
}
0