daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Apr 24th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Sky {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int n = Integer.parseInt(scanner.nextLine());
  8.  
  9.  
  10.         if (n % 2 != 0) {
  11.  
  12.  
  13.             System.out.println(draw(" ", n - 1) + "_|_" + draw(" ", n - 1));
  14.         } else {
  15.             System.out.println(draw(" ", n + 1) + "|" + draw(" ", n + 1));
  16.         }
  17.  
  18.         for (int i = 0; i < n - 2; i++) {
  19.            
  20.             System.out.println(draw(" ", n - 2) + "_|-|_" + draw("", n - 2));
  21.  
  22.         }
  23.         System.out.println(draw(" ", n - 2) + "|***|" + draw(" ", n - 2));
  24.  
  25.  
  26.         for (int i = 0; i < 4*n - 1 ; i++) {
  27.             System.out.println(draw(" ", n - 2) + "|---|" + draw(" ", n - 2));
  28.  
  29.         }
  30.         System.out.println(draw("_", n - 2) + "|---|" + draw("_", n - 2));
  31.  
  32.         System.out.println(draw("|", n*2 + 1));
  33.     }
  34.  
  35.  
  36.     public static String draw(String str,int count) {
  37.             StringBuilder output = new StringBuilder();
  38.  
  39.             for (int i = 0; i < count; i++) {
  40.                 output.append(str);
  41.  
  42.             }
  43.  
  44.             return output.toString();
  45.  
  46.         }
  47.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top