結果

問題 No.289 数字を全て足そう
コンテスト
ユーザー aaa aa
提出日時 2025-11-11 15:29:59
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 9,124 ms
コンパイル使用メモリ 166,792 KB
実行使用メモリ 189,832 KB
最終ジャッジ日時 2025-11-11 15:30:12
合計ジャッジ時間 11,343 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 2 WA * 18 RE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (122 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Text.RegularExpressions;
public class Program
{
    public static void Main()
    {
        string str = Console.ReadLine() ?? string.Empty;

        string change = Regex.Replace(str, @"[^0-9]", "");
        //Console.WriteLine(change);

        int count = 0;
        for (int i = 0; i < change.Length; i++)
        {
            count += int.Parse(change.Substring(1, 1));
        }
        Console.WriteLine(count);
    }
}
0