結果

問題 No.18 うーさー暗号
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-03 18:42:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 166 ms / 5,000 ms
コード長 434 bytes
コンパイル時間 2,848 ms
コンパイル使用メモリ 71,292 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-09-21 12:06:06
合計ジャッジ時間 5,531 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
55,664 KB
testcase_01 AC 111 ms
56,264 KB
testcase_02 AC 118 ms
53,820 KB
testcase_03 AC 163 ms
56,348 KB
testcase_04 AC 150 ms
55,776 KB
testcase_05 AC 152 ms
55,712 KB
testcase_06 AC 161 ms
55,888 KB
testcase_07 AC 154 ms
56,092 KB
testcase_08 AC 166 ms
56,024 KB
testcase_09 AC 151 ms
56,108 KB
testcase_10 AC 115 ms
55,572 KB
testcase_11 AC 115 ms
55,700 KB
testcase_12 AC 157 ms
56,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		String sen = in.next();
		int n = sen.length();
		char[] senArr = sen.toCharArray();
		for(int i=0; i<n; i++) {
			for(int j=0; j<n; j++) {
				if(senArr[j] == 'A') {
					senArr[j] = 'Z';
				} else {
					senArr[j] = (char)(senArr[j] - 1);
				}
			}
			System.out.print(senArr[i]);
		}
	}
}
0