結果

問題 No.18 うーさー暗号
ユーザー sasakkisasakki
提出日時 2016-04-08 16:46:18
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 3,807 ms
コンパイル使用メモリ 73,844 KB
実行使用メモリ 56,732 KB
最終ジャッジ日時 2023-09-21 12:13:44
合計ジャッジ時間 4,619 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
56,184 KB
testcase_01 AC 113 ms
56,160 KB
testcase_02 AC 113 ms
55,776 KB
testcase_03 AC 122 ms
56,096 KB
testcase_04 AC 124 ms
55,716 KB
testcase_05 AC 119 ms
56,128 KB
testcase_06 AC 121 ms
55,736 KB
testcase_07 AC 120 ms
56,372 KB
testcase_08 AC 122 ms
56,136 KB
testcase_09 AC 120 ms
56,732 KB
testcase_10 AC 112 ms
55,828 KB
testcase_11 AC 111 ms
56,164 KB
testcase_12 AC 119 ms
56,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class main{
    public static void main(String args[]){
	Scanner scan = new Scanner(System.in);
	String str = scan.next();

	char c = 'A';

	String wooser = "";

	for(int i = 0; i < str.length(); i++){
	    int no = i + 1;

	    char ch = str.charAt(i);
	    
	    if(no > 26){
		for(;;){
		    if(no < 26){
			break;
		    }
		    else{
			no -= 26;
		    }
		}
	    }

	    ch -= no;

	    if( (int)ch < 65 ){
		ch += 26;
	    }

	    String str_ch = String.valueOf(ch);

	    wooser = wooser + str_ch;

	}
	
	System.out.println(wooser);
	
    }
    
}
0