結果

問題 No.18 うーさー暗号
ユーザー Koketti1Koketti1
提出日時 2017-02-05 23:18:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 1,839 ms
コンパイル使用メモリ 72,196 KB
実行使用メモリ 56,380 KB
最終ジャッジ日時 2023-09-21 12:36:33
合計ジャッジ時間 4,364 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
55,556 KB
testcase_01 AC 111 ms
55,856 KB
testcase_02 AC 116 ms
56,236 KB
testcase_03 AC 156 ms
55,956 KB
testcase_04 AC 131 ms
56,200 KB
testcase_05 AC 142 ms
56,116 KB
testcase_06 AC 152 ms
56,380 KB
testcase_07 AC 154 ms
56,048 KB
testcase_08 AC 151 ms
55,860 KB
testcase_09 AC 143 ms
56,144 KB
testcase_10 AC 115 ms
56,168 KB
testcase_11 AC 116 ms
55,900 KB
testcase_12 AC 145 ms
56,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		for(int i = 0;i < S.length();i++){
			if((char)(S.charAt(i)-(i+1)%26) < 'A') {
				System.out.print( (char)(S.charAt(i)-(i+1)%26+26));
			}else{
				System.out.print( (char)(S.charAt(i)-(i+1)%26));
			}
		}
		System.out.println();
		scanner.close();
	}
}
0