Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class STOP {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n = Integer.parseInt(sc.nextLine());
- int points = n+1;
- int width = (n+1)*4+1;
- int line = width/2+1;
- System.out.println(repeatString(".",points)+repeatString("_",line)+repeatString(".",points));
- int line2 = width-n*2-4;
- for (int i = 1; i <= n; i++){
- points--;
- System.out.print(repeatString(".",points)+"//");
- System.out.println(repeatString("_",line2)+"\\\\"+repeatString(".",points));
- line2+=2;
- }
- System.out.println("//"+repeatString("_",(width-9)/2)+"STOP!"+repeatString("_",(width-9)/2)+"\\\\");
- System.out.println("\\\\"+repeatString("_",width-4)+"//");
- int point2 = 1;
- int line3 = width-6;
- for (int i = 1; i<n; i++){
- System.out.println(repeatString(".",point2)+"\\\\"+repeatString("_",line3)+"//"+repeatString(".",point2));
- point2++;
- line3-=2;
- }
- }
- static String repeatString (String toRepeat, int count){
- String text = "";
- for (int i = 1; i <= count; i++){
- text = text + toRepeat;
- }
- return text;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment