結果
| 問題 |
No.289 数字を全て足そう
|
| コンテスト | |
| ユーザー |
ProgramingWe
|
| 提出日時 | 2017-10-27 16:57:16 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 1,000 ms |
| コード長 | 755 bytes |
| コンパイル時間 | 779 ms |
| コンパイル使用メモリ | 107,492 KB |
| 実行使用メモリ | 25,840 KB |
| 最終ジャッジ日時 | 2024-11-21 20:50:35 |
| 合計ジャッジ時間 | 2,148 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.
ソースコード
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
char[] cs = Console.ReadLine().ToCharArray();
List<int> listn = new List<int>();
int s;
int a = 0;
int count = 0;
for (int i = 0; i < cs.Length; i++)
{
if (int.TryParse(cs[i].ToString(), out s))
{
listn.Add(int.Parse(cs[i].ToString()));
}
}
for (int i = 0; i < listn.Count; i++)
{
count = count + listn[i];
}
Console.WriteLine(count);
}
}
}
ProgramingWe