結果

問題 No.18 うーさー暗号
ユーザー TakaTaka
提出日時 2016-11-07 19:54:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 5,000 ms
コード長 525 bytes
コンパイル時間 2,122 ms
コンパイル使用メモリ 71,476 KB
実行使用メモリ 56,260 KB
最終ジャッジ日時 2023-09-21 12:33:04
合計ジャッジ時間 4,975 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
55,664 KB
testcase_01 AC 109 ms
55,628 KB
testcase_02 AC 116 ms
55,812 KB
testcase_03 AC 157 ms
55,816 KB
testcase_04 AC 146 ms
55,836 KB
testcase_05 AC 144 ms
56,060 KB
testcase_06 AC 158 ms
55,872 KB
testcase_07 AC 155 ms
56,000 KB
testcase_08 AC 156 ms
56,128 KB
testcase_09 AC 145 ms
56,260 KB
testcase_10 AC 120 ms
55,660 KB
testcase_11 AC 118 ms
55,624 KB
testcase_12 AC 148 ms
56,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;
class a{
    public static void main(String[] b){
        Scanner sc=new Scanner(System.in);
		String a=sc.next();
		
		int t[]=new int[a.length()];
		char u[]=new char[a.length()];
		Arrays.fill(t,0);
		
		int n;
		for(int i=0;i<a.length();i++){
			n=a.charAt(i);
			t[i]=n-i-1;
			if(t[i]<65){
				do{
					t[i]+=26;
				}while(t[i]<65);
				
			}
			u[i]=(char)t[i];
		}
		
		for(int i=0; i<a.length(); i++){
			System.out.print(u[i]);
		}
		System.out.println();
    }
}
0