1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import java.math.BigInteger;
 
import java.util.Scanner;
 
 
 
public class Main {
 
    public static String palindrom(String n){
 
        BigInteger b = new BigInteger(n);
 
        String bn = b.toString();//원래수
 
        String rbn = new StringBuilder(bn).reverse().toString();//뒤집은수
 
        while(!bn.equals(rbn)){
 
            b = b.add(BigInteger.ONE);
 
            bn = b.toString();
 
            rbn = new StringBuilder(bn).reverse().toString();
 
        }
 
        return bn;
 
    }
 
    public static String caesar(String s){
 
        String result = "";
 
        for(int i=0;i<s.length();i++){
 
            char c =(char) (s.charAt(i)-3);
 
            if(c<65)
 
                c+=26;
 
            result +=c;
 
        }
 
        return result;
 
    }
 
    public static void main(String[] args) {
 
        Scanner sc = new Scanner(System.in);
 
        String m = sc.nextLine();
 
        System.out.println(caesar(m));
 
    }
 
}
cs


'알고리즘' 카테고리의 다른 글

[11729번] 하노이 탑 이동 순서  (0) 2017.08.13
[11053번] 가장 긴 증가하는 부분 수열  (0) 2017.08.13
[9084번] 동전  (0) 2017.08.13
[2616번] 소형기관차  (0) 2017.08.13
[2609번] 최대공약수와 최소공배수  (0) 2017.08.13

+ Recent posts