結果

問題 No.18 うーさー暗号
ユーザー sasakkisasakki
提出日時 2016-04-08 16:46:18
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 76,260 KB
実行使用メモリ 53,976 KB
最終ジャッジ日時 2024-07-07 06:05:19
合計ジャッジ時間 4,011 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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