結果

問題 No.18 うーさー暗号
ユーザー kmtrc130kmtrc130
提出日時 2017-04-03 15:12:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 455 bytes
コンパイル時間 2,500 ms
コンパイル使用メモリ 106,848 KB
実行使用メモリ 23,532 KB
最終ジャッジ日時 2023-09-21 12:40:48
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
21,516 KB
testcase_01 AC 57 ms
21,564 KB
testcase_02 AC 57 ms
23,480 KB
testcase_03 AC 60 ms
23,464 KB
testcase_04 AC 58 ms
23,532 KB
testcase_05 AC 59 ms
21,424 KB
testcase_06 AC 59 ms
21,456 KB
testcase_07 AC 59 ms
21,524 KB
testcase_08 AC 59 ms
23,416 KB
testcase_09 AC 59 ms
21,492 KB
testcase_10 AC 59 ms
21,456 KB
testcase_11 AC 58 ms
21,468 KB
testcase_12 AC 58 ms
21,520 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;

class Program
{
    static void Main(string[] args)
    {
        string S = Console.ReadLine();

        int code;
        foreach (var s in S.ToArray().Select((val, idx) => new { val, idx }))
        {
            code = (int)s.val - (s.idx + 1);
            while (code < 65)
            {
                code += 26;
            }
            Console.Write((char)code);
        }
        Console.WriteLine();
    }
}
0