Skip to content

Commit 1d3dd40

Browse files
committed
BOJ #17285: XORChic
1 parent 0ae89f5 commit 1d3dd40

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

BOJ/17285/Main.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Author: Minho Kim (ISKU)
3+
* Date: June 30, 2019
4+
* E-mail: minho.kim093@gmail.com
5+
*
6+
* https://github.com/ISKU/Algorithm
7+
* https://www.acmicpc.net/problem/17285
8+
*/
9+
10+
import java.io.*;
11+
12+
public class Main {
13+
public static void main(String[] args) throws Exception {
14+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
15+
char[] line = br.readLine().toCharArray();
16+
17+
int key = 0;
18+
for (int i = 0; i < 128; i++) {
19+
if ((line[0] ^ i) == 'C') {
20+
key = i;
21+
break;
22+
}
23+
}
24+
25+
for (int i = 0; i < line.length; i++)
26+
System.out.print((char) (line[i] ^ key));
27+
}
28+
}

0 commit comments

Comments
 (0)