Skip to content

Instantly share code, notes, and snippets.

@peter279k
Created December 22, 2015 01:59
Show Gist options
  • Save peter279k/ef4558b81b1eba2f298e to your computer and use it in GitHub Desktop.
Save peter279k/ef4558b81b1eba2f298e to your computer and use it in GitHub Desktop.
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while(input.hasNext()) {
String str = input.nextLine();
str = str.toLowerCase();
String result = "";
String str2 = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./";
for(int i=0;i<str.length();i++) {
if(str.charAt(i) == ' ') {
result += " ";
continue;
}
for(int j=0;j<str2.length();j++) {
if(str.charAt(i) == str2.charAt(j)) {
result += str2.charAt(j-2);
}
}
}
System.out.println(result);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment