結果

問題 No.18 うーさー暗号
ユーザー YOSHIYOSHI
提出日時 2021-02-17 11:53:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 3,731 ms
コンパイル使用メモリ 71,576 KB
実行使用メモリ 56,320 KB
最終ジャッジ日時 2023-10-11 23:10:40
合計ジャッジ時間 5,883 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,660 KB
testcase_01 AC 120 ms
55,624 KB
testcase_02 AC 122 ms
55,828 KB
testcase_03 AC 125 ms
55,680 KB
testcase_04 AC 123 ms
55,576 KB
testcase_05 AC 122 ms
55,816 KB
testcase_06 AC 123 ms
56,012 KB
testcase_07 AC 125 ms
55,788 KB
testcase_08 AC 124 ms
55,756 KB
testcase_09 AC 122 ms
56,320 KB
testcase_10 AC 123 ms
55,456 KB
testcase_11 AC 122 ms
55,456 KB
testcase_12 AC 121 ms
56,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No00000018_Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		char[] charA = scan.nextLine().toCharArray();
		char[] charB = new char[charA.length];

		for(int i = 0; i < charA.length; i++) {
			charB[i] = (char)((charA[i] - ((i + 1) % 26) + 'A') % 26 + 'A');
		}

		System.out.println(new String(charB));

		scan.close();

	}

}
0