結果

問題 No.18 うーさー暗号
ユーザー omc-testomc-test
提出日時 2016-08-04 11:42:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 175 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 3,603 ms
コンパイル使用メモリ 71,984 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2023-09-21 12:22:57
合計ジャッジ時間 6,201 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,608 KB
testcase_01 AC 123 ms
55,296 KB
testcase_02 AC 130 ms
56,196 KB
testcase_03 AC 175 ms
56,008 KB
testcase_04 AC 157 ms
55,768 KB
testcase_05 AC 158 ms
56,128 KB
testcase_06 AC 160 ms
55,784 KB
testcase_07 AC 170 ms
55,836 KB
testcase_08 AC 163 ms
55,504 KB
testcase_09 AC 158 ms
55,964 KB
testcase_10 AC 128 ms
55,740 KB
testcase_11 AC 130 ms
55,776 KB
testcase_12 AC 160 ms
55,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No0018 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		for(int i=0; i<s.length(); i++){
			char c = s.charAt(i);
			int a = (int)c - (i%26) - 1;
			if(a >= 65 && a <= 90){
				c = (char)a;
			}else{
				c = (char)(a + 26);
			}
			System.out.print(c);
		}
		System.out.println();
	}
}
0