import java.util.Scanner;
public class Main {
static char[] arr = {'`','1','2','3','4','5','6','7','8','9','0','-','=',
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']','\\',
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';','\'',
'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/'};
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (s.hasNext()) {
String m = s.nextLine();
String temp = "";
for (int i = 0; i < m.length(); i++) {
if (m.charAt(i) == ' ') {
temp +=" ";
}else if(m.charAt(i) == '\n'){
temp +="\n";
}
else {
int index = search(arr, m.charAt(i));
temp += arr[index - 1];
}
}
System.out.println(temp);
}
}
static int search(char[] arr, char temp) {
for (int i = 0; i < arr.length; i++) {
if (arr[i] == temp) {
return i;
}
}
return -1;
}
}
No comments:
Post a Comment