結果

問題 No.18 うーさー暗号
ユーザー masuyuumasuyuu
提出日時 2020-09-17 22:11:53
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 569 bytes
コンパイル時間 3,605 ms
コンパイル使用メモリ 72,888 KB
実行使用メモリ 56,392 KB
最終ジャッジ日時 2023-09-04 07:40:24
合計ジャッジ時間 4,849 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,688 KB
testcase_01 AC 125 ms
55,928 KB
testcase_02 AC 130 ms
55,840 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] a = s.toCharArray();
		char[] c = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
		int y = 0;
		for(int i=0;i<a.length;i++) {
			for(int x=0;x<c.length;x++) {
			if(a[i]==c[x]) {
				if(x-i-1<0) {
					while(x-i-1+y<0) {
						y+=c.length;
					}
					System.out.print(c[x-i-1+y]);
				}else {
				System.out.print(c[x-i-1]);
				}
			}
			}
		}
	}
}
0