-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOkviri.java
46 lines (37 loc) · 1.23 KB
/
Okviri.java
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
36
37
38
39
40
41
42
43
44
45
46
/*
Problem: https://open.kattis.com/problems/okviri
Author: Adrian Reithaug
Submitted: June 28th, 2017
Time: 0.09s / 1.00s
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Okviri {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String word = reader.readLine();
String outer = "..#..";
String inner = ".#.#.";
String middle = "#." + word.charAt(0) + ".#";
int count = 1;
for (int i = 1; i < word.length(); i++) {
count++;
if (count % 3 == 0) {
outer += ".*..";
inner += "*.*.";
middle += "." + word.charAt(i) + ".*";
} else {
outer += ".#..";
inner += "#.#.";
middle += "." + word.charAt(i) + ".";
if ((count + 1) % 3 == 0 && i != word.length() - 1) {
middle += "*";
} else {
middle += "#";
}
}
}
System.out.println(outer + "\n" + inner + "\n" + middle + "\n" + inner + "\n" + outer);
}
}