Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class deciphering {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String input = scan.nextLine();
- String[] input2 = scan.nextLine().split("\\s+");
- String output = "";
- if (input.charAt(0) < 100 && !input.contains("{}#\\|")) {
- System.out.println("This is not the book you are looking for.");
- return;
- }
- for (int i = 0; i < input.length(); i++) {
- char x = (char) (input.charAt(i) - 3);
- output += x;
- }
- while (output.contains(input2[0])) {
- output = output.replace(input2[0], input2[1]);
- }
- System.out.println(output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment