SHARE
TWEET

Untitled

a guest Jun 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package DANI;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class STOP {
  6.  
  7.     static void generateString(int m, String str) {
  8.         for (int i = 0; i < m; i++) {
  9.             System.out.print(str);
  10.         }
  11.     }
  12.  
  13.     public static void main(String[] args) {
  14.  
  15.         Scanner sc = new Scanner(System.in);
  16.  
  17.         int n = Integer.parseInt(sc.nextLine());
  18.  
  19.         generateString(n + 1, ".");
  20.         generateString(2 * n + 1, "_");
  21.         generateString(n + 1, ".");
  22.         System.out.println();
  23.  
  24.         for (int row = 0; row < n; row++) {
  25.             generateString(n - row, ".");
  26.             System.out.print("//");
  27.             generateString(2 * n + 2 * row - 1, "_");
  28.             System.out.print("\\\\");
  29.             generateString(n - row, ".");
  30.             System.out.println();
  31.         }
  32.  
  33.         System.out.print("//");
  34.         generateString(2 * n - 3, "_");
  35.         System.out.print("STOP!");
  36.         generateString(2 * n - 3, "_");
  37.         System.out.println("\\\\");
  38.  
  39.         for (int row = n; row > 0; row--) {
  40.             generateString(n - row, ".");
  41.             System.out.print("\\\\");
  42.             generateString(2 * n + 2 * row - 1, "_");
  43.             System.out.print("//");
  44.             generateString(n - row, ".");
  45.             System.out.println();
  46.  
  47.         }
  48.     }
  49. }
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