fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main {
  6. public static void main (String[] args) {
  7. String x = new String();
  8. Scanner sc = new Scanner(System.in);
  9. String y = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
  10. try {
  11. while (sc.hasNextLine()) {
  12. x = sc.nextLine();
  13. x = x.toUpperCase();
  14. int found;
  15. for (int i = 0; i < x.length(); i++) {
  16. if (x.charAt(i) == ' ') {
  17. System.out.print(" ");
  18. } else {
  19. found = y.indexOf(x.charAt(i));
  20. if (found == 0) found = y.length();
  21. System.out.print(y.charAt(found-1));
  22. }
  23. }
  24. System.out.print("\n");
  25. }
  26. } finally {
  27. sc.close();
  28. }
  29. }
  30. }
Success #stdin #stdout 0.15s 321344KB
stdin
vpfr rbrtuejrtr. rbrtufsu
stdout
CODE EVERYWHERE, EVERYDAY