結果
問題 | No.18 うーさー暗号 |
ユーザー |
![]() |
提出日時 | 2018-05-07 14:45:48 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 184 ms / 5,000 ms |
コード長 | 801 bytes |
コンパイル時間 | 3,574 ms |
コンパイル使用メモリ | 76,188 KB |
実行使用メモリ | 43,208 KB |
最終ジャッジ日時 | 2024-06-28 02:16:38 |
合計ジャッジ時間 | 6,645 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
import java.util.*;public class UsaCord {public static void main(String[] args){Scanner scanner = new Scanner(System.in);String InputText =scanner.next(); //暗号化する文字列String CipherText = ""; //暗号化後のデータ格納int RepetitionNumber = 0; //繰り返し数の定義for(int i=0 ; i<InputText.length() ; i++){RepetitionNumber = i + 1;char no = (char) RepetitionNumber; //繰り返し数だけ文字をずらすint num = InputText.charAt(i) - no;while(num <= 64){num = num + 26;}CipherText = CipherText +((char)num);}System.out.println(CipherText);}}