結果

問題 No.18 うーさー暗号
ユーザー PE11PE11
提出日時 2018-02-02 15:27:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 2,455 ms
コンパイル使用メモリ 102,184 KB
実行使用メモリ 23,336 KB
最終ジャッジ日時 2023-09-21 12:59:03
合計ジャッジ時間 3,820 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
23,292 KB
testcase_01 AC 49 ms
23,336 KB
testcase_02 AC 49 ms
21,220 KB
testcase_03 AC 52 ms
21,212 KB
testcase_04 AC 50 ms
21,276 KB
testcase_05 AC 49 ms
21,280 KB
testcase_06 AC 51 ms
21,248 KB
testcase_07 AC 50 ms
21,168 KB
testcase_08 AC 50 ms
21,284 KB
testcase_09 AC 51 ms
21,256 KB
testcase_10 AC 49 ms
21,256 KB
testcase_11 AC 48 ms
21,284 KB
testcase_12 AC 49 ms
21,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

public class Program
{

	static void Main()
	{
		var CharList = Console.ReadLine().ToCharArray().ToList<char>();

		for (int i = 0; i < CharList.Count; i++)
		{
			Console.Write(ConverAlpha(Convert.ToInt32(CharList[i]) - (i + 1 % 26)));
		}

		Console.WriteLine();
	}


	private static char ConverAlpha(int CharCode)
	{		
		if (Convert.ToInt32('A') > CharCode)
			return ConverAlpha(CharCode + 26);


		return Convert.ToChar(CharCode);
	}
}



0