Advertisement
meteor4o

Java-Fund-DataMore- 05.DecryptingMessage

May 29th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6.  
  7. int key = Integer.parseInt(sc.nextLine());
  8. int lines = Integer.parseInt(sc.nextLine());
  9. // System.out.println();
  10.  
  11. for(int i = 0; i < lines; i++) {
  12. char result = sc.nextLine().charAt(0);
  13. if (i == 0) {
  14. System.out.println();
  15. }
  16. System.out.print((char)(result + key));
  17. }
  18.  
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement