Add tags

Add tags to the following comment
 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Sample139 {
    public static final int MOVE = 3;

    public static String calc(String input) {
        StringBuilder builder = new StringBuilder();
        for (char c: input.toCharArray()) {
            char d = (char) (c - MOVE);
            if (d < 'A') d = (char) (d + ('Z' - 'A' + 1));
            builder.append(d);
        }
        return builder.toString();
    }

    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            System.out.println(calc(reader.readLine()));
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...