結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2016-10-20 16:30:32 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 108,452 KB |
実行使用メモリ | 26,080 KB |
最終ジャッジ日時 | 2024-11-22 16:36:38 |
合計ジャッジ時間 | 2,240 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 3 WA * 18 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Program { static void Main() { string S = Console.ReadLine(); string S_ = ""; int _S = 0; int result = 0; for (int i = 0; i < S.Length; i++) { S_ = S.Substring(0,1); if (int.TryParse(S_, out _S)) { result += _S; } } Console.WriteLine(result.ToString()); } }