Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DecryptingMessage {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int key = Integer.parseInt(scanner.nextLine());
- int n = Integer.parseInt(scanner.nextLine());
- String message = "";
- for (int i=1; i<=n; i++) {
- char ch = scanner.nextLine().charAt(0);
- message += (char) ((int) ch + key);
- }
- System.out.println(message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement