Advertisement
Spocoman

05. Decrypting Message

Oct 19th, 2024
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int key = Integer.parseInt(scanner.nextLine()),
  7.             n = Integer.parseInt(scanner.nextLine());
  8.         String message = "";
  9.        
  10.         for (int i = 0; i < n; i++) {
  11.             message += Character.toString(scanner.nextLine().charAt(0) + key);
  12.         }
  13.        
  14.         System.out.println(message);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement