結果

問題 No.18 うーさー暗号
ユーザー spacenautspacenaut
提出日時 2016-05-15 23:01:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 172 ms / 5,000 ms
コード長 409 bytes
コンパイル時間 2,307 ms
コンパイル使用メモリ 71,440 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2023-09-21 12:18:44
合計ジャッジ時間 4,920 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,900 KB
testcase_01 AC 122 ms
55,656 KB
testcase_02 AC 129 ms
56,020 KB
testcase_03 AC 172 ms
55,824 KB
testcase_04 AC 158 ms
55,752 KB
testcase_05 AC 158 ms
56,108 KB
testcase_06 AC 172 ms
55,980 KB
testcase_07 AC 172 ms
55,788 KB
testcase_08 AC 162 ms
55,984 KB
testcase_09 AC 170 ms
55,748 KB
testcase_10 AC 127 ms
55,480 KB
testcase_11 AC 132 ms
55,600 KB
testcase_12 AC 162 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class No0013{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] st = new char[s.length()];
		int res = 0;

		for(int i = 0; i < s.length(); i++){
			st[i] = s.charAt(i);
			res = (int)(st[i] - i - 1);
			while(res < 'A'){
				res += 26;
			}
			st[i] = (char)res;

			System.out.print(st[i]);
		}
		System.out.println();
	}
}
0