eriezelagera

JewelHex

Feb 3rd, 2015
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         final String s = "QWERTY";
  3.         String result = "";
  4.        
  5.         for (char ch : s.toCharArray()) {
  6.             if (ch == 'Q')
  7.                 result += "A";
  8.             else if (ch == 'W')
  9.                 result += "B";
  10.             else if (ch == 'E')
  11.                 result += "C";
  12.             else if (ch == 'R')
  13.                 result += "D";
  14.             else if (ch == 'T')
  15.                 result += "E";
  16.             else if (ch == 'Y')
  17.                 result += "F";
  18.         }
  19.        
  20.         System.out.println(Integer.parseInt(result, 16));
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment