結果
| 問題 | 
                            No.432 占い(Easy)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             No
                         | 
                    
| 提出日時 | 2016-10-14 23:35:10 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 396 ms / 2,000 ms | 
| コード長 | 1,262 bytes | 
| コンパイル時間 | 2,348 ms | 
| コンパイル使用メモリ | 111,416 KB | 
| 実行使用メモリ | 21,888 KB | 
| 最終ジャッジ日時 | 2024-11-22 06:29:35 | 
| 合計ジャッジ時間 | 4,552 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 22 | 
コンパイルメッセージ
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.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yukikoda
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            var s = new List<string>();
            for (int i = 0; i < t; i++)
            {
                s.Add(Console.ReadLine());
            }
            foreach (var item in s)
            {
                Console.WriteLine(aa(item));
            }
        }
        static string aa(string s)
        {
            if (s.Length == 1)
            {
                return s;
            }
            int a;
            string s2 = "";
            while (s.Length != 1)
            {
                s2 = "";
                for (int i = 0; i < s.Length - 1; i++)
                {
                    a = int.Parse(s[i].ToString()) + int.Parse(s[i + 1].ToString());
                    if (a >= 10)
                    {
                        a = int.Parse(a.ToString()[0].ToString()) + int.Parse(a.ToString()[1].ToString());
                    }
                    s2 = s2 + a;
                }
                s = s2;
            }
            return s2;
        }
    }
}
            
            
            
        
            
No