結果
問題 |
No.18 うーさー暗号
|
ユーザー |
|
提出日時 | 2020-09-17 22:11:53 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 569 bytes |
コンパイル時間 | 1,998 ms |
コンパイル使用メモリ | 74,316 KB |
実行使用メモリ | 54,524 KB |
最終ジャッジ日時 | 2024-06-22 06:54:24 |
合計ジャッジ時間 | 3,961 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 RE * 10 |
ソースコード
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); char[] a = s.toCharArray(); char[] c = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int y = 0; for(int i=0;i<a.length;i++) { for(int x=0;x<c.length;x++) { if(a[i]==c[x]) { if(x-i-1<0) { while(x-i-1+y<0) { y+=c.length; } System.out.print(c[x-i-1+y]); }else { System.out.print(c[x-i-1]); } } } } } }