Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ExamTime;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Lamp {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- int n = Integer.parseInt(reader.readLine());
- int slashesCount = (2 * n + 8) / 2;
- int weidth = (4 * n + 11);
- int dots = (2 * n + 8) / 2;
- System.out.print(repeat(".", slashesCount));
- System.out.print(repeat("_", slashesCount - 4));
- System.out.print("/|\\");
- System.out.print(repeat("_", slashesCount - 4));
- System.out.println(repeat(".", slashesCount));
- System.out.print(repeat(".", slashesCount));
- System.out.print("/");
- System.out.print(repeat("-", slashesCount + n - 3));
- System.out.print("\\");
- System.out.println(repeat(".", slashesCount));
- slashesCount--;
- for (int i = 0; i < (n - 2); i++) {
- System.out.print(repeat(".", slashesCount));
- System.out.print("/");
- System.out.print(repeat(".", dots + i * 2 + n - 1));
- System.out.print("\\");
- System.out.println(repeat(".", slashesCount));
- slashesCount--;
- }
- dots = (2 * n + 8 - 9);
- System.out.print(repeat(".", slashesCount));
- System.out.print("/");
- System.out.print(repeat("_", dots * 2 + 1));
- System.out.print("\\");
- System.out.println(repeat(".", slashesCount));
- slashesCount--;
- for (int i = 0; i <= (n - 2) / 2; i++) {
- System.out.print(repeat(".", slashesCount));
- System.out.print("/");
- System.out.print(repeat(".", dots + i * 2 + n + n + 2));
- System.out.print("\\");
- System.out.println(repeat(".", slashesCount));
- slashesCount--;
- }
- System.out.print("./");
- System.out.print(repeat("_", weidth - 4));
- System.out.println("\\.");
- System.out.print("/");
- System.out.print(repeat("_", weidth - 2));
- System.out.println("\\");
- for (int i = 0; i < n; i++) {
- System.out.print(repeat(".", weidth / 2 - 1));
- System.out.print("|$|");
- System.out.println(repeat(".", weidth / 2 - 1));
- }
- System.out.print("....");
- System.out.print(repeat("_", weidth / 2 - 5));
- System.out.print("|$|");
- System.out.print(repeat("_", weidth / 2 - 5));
- System.out.println("....");
- System.out.print("...");
- System.out.print("/");
- System.out.print(repeat("_", weidth / 2 + n + n - 2));
- System.out.print("\\");
- System.out.print("...");
- }
- private static String repeat (String symbol, int count){
- StringBuilder builder = new StringBuilder();
- for (int i = 0; i < count; i++) {
- builder.append(symbol);
- }
- return builder.toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement