結果

問題 No.432 占い(Easy)
ユーザー abL8ZLsTbF
提出日時 2016-10-14 22:36:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 4,356 ms
コンパイル使用メモリ 112,100 KB
実行使用メモリ 29,792 KB
最終ジャッジ日時 2024-11-22 07:27:26
合計ジャッジ時間 3,660 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Text;

public class Program
{
	public static void Main()
	{
		int T = int.Parse(Console.ReadLine());
		for (int i = 0; i < T; i++)
		{
			var S = Console.ReadLine();
			while (S.Length > 1)
			{
				var sb = new StringBuilder();
				for (int j = 0; j < S.Length - 1; j++)
				{
					int temp = S[j] - '0' + S[j + 1] - '0';
					if (temp > 9)
					{
						temp = 1 + temp % 10;
					}
					sb.Append(temp.ToString());
				}
				S = sb.ToString();
			}
			Console.WriteLine(S);
		}
	}
}
0