結果

問題 No.18 うーさー暗号
ユーザー r.suzukir.suzuki
提出日時 2016-01-24 02:00:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 842 bytes
コンパイル時間 4,306 ms
コンパイル使用メモリ 74,760 KB
実行使用メモリ 57,760 KB
最終ジャッジ日時 2023-10-21 13:52:38
合計ジャッジ時間 7,061 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,128 KB
testcase_01 AC 133 ms
57,120 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 137 ms
57,196 KB
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

interface Converter {
	void encode();
	void decode();
}

class U_SA_ implements Converter {
	private final int firstNum = 65;
	private final int lastNum = 90;
	private char[] code;

	public U_SA_(String s) {
		this.code = s.toCharArray();
	}

	public void encode() {

	}

	public void decode() {
		for (int i = 0; i < code.length; i++) {
			code[i] -= (i + 1);
			code[i] = checkD(code[i]);
		}
	}

	public char checkE(char c) {
		return c;
	}

	public char checkD(char c) {
		if (c >= firstNum) {
			return c;
		} else {
			c += 26;
			return checkD(c);
		}
	}

	public void printCode() {
		System.out.println(this.code);
	}
}

public class No_18 {

	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);

		U_SA_ u_sa_ = new U_SA_(sc.next());

		u_sa_.decode();

		u_sa_.printCode();

	}

}



0