Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4.  * Created by Dako on 16.3.2017 г..
  5.  */
  6. public class z3 {
  7.     public static void main(String[] args) {
  8.         Scanner console = new Scanner(System.in);
  9.  
  10.         int n = Integer.parseInt(console.nextLine());
  11.  
  12.         String dot = doMagic(".", n * 2 - 1);
  13.  
  14.         System.out.println(dot + "/|\\" + dot);
  15.         System.out.println(dot + "\\|/" + dot);
  16.         System.out.println(dot + "***" + dot);
  17.  
  18.         for (int i = 0; i < n * 2 - 1; i++)
  19.  
  20.         {
  21.             System.out.print(doMagic(".",n*2-2-i));
  22.             System.out.print("*");
  23.             System.out.print(doMagic("-", i+1));
  24.             System.out.print("*");
  25.             System.out.print(doMagic("-", i+1));
  26.             System.out.print("*");
  27.             System.out.print(doMagic(".",n*2-2-i));
  28.             System.out.println();
  29.         }
  30.  
  31.             System.out.println(doMagic("*", n * 4 + 1));
  32.             System.out.print("*");
  33.             System.out.println(doMagic(".*", n * 2 ));
  34.             System.out.println(doMagic("*", n * 4 + 1));
  35.     }
  36.  
  37.     public static String doMagic(String text, int repeatCount) {
  38.         String output = "";
  39.         for (int i = 0; i < repeatCount; i++) {
  40.             output = output + text;
  41.         }
  42.         return output;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement