-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathURI1196WERTYU.java
More file actions
35 lines (30 loc) · 1.03 KB
/
URI1196WERTYU.java
File metadata and controls
35 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
/**
* See
* <a href="https://www.urionlinejudge.com.br/judge/en/problems/view/1196">WERTYU</a>
*
* @author Brian Yeicol Restrepo Tangarife
*/
public class URI1196WERTYU {
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
static PrintWriter out = new PrintWriter(System.out);
static final String ALPHABETH = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
static final char[] KEYBOARD = ALPHABETH.toCharArray();
public static void main(String[] args) throws IOException {
String line;
char[] input;
int index;
while ((line = in.readLine()) != null) {
input = line.toCharArray();
for (char letter : input) {
index = ALPHABETH.indexOf(letter);
out.print(index != -1 ? KEYBOARD[index - 1] : letter);
}
out.println();
}
out.close();
}
}