Advertisement
CR7CR7

decr

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