Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- final String s = "QWERTY";
- String result = "";
- for (char ch : s.toCharArray()) {
- if (ch == 'Q')
- result += "A";
- else if (ch == 'W')
- result += "B";
- else if (ch == 'E')
- result += "C";
- else if (ch == 'R')
- result += "D";
- else if (ch == 'T')
- result += "E";
- else if (ch == 'Y')
- result += "F";
- }
- System.out.println(Integer.parseInt(result, 16));
- }
Advertisement
Add Comment
Please, Sign In to add comment