SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. public class teeest {
  3.     public static void main(String[] args) {
  4.   Scanner scan = new Scanner(System.in);
  5.   int number = Integer.parseInt(scan.nextLine());
  6.  String onlyStars = repeatString("*",number);
  7.  String middleRows = "*" +repeatString(" ",number - 2)+"*";
  8.    System.out.println(onlyStars);
  9.    for (int i=0;i<number-2; i++)         {             System.out.println(middleRows); is
  10.     }
  11.             System.out.println(repeatString("*",number));
  12.  }
  13.   public static String repeatString(String symbol, int count) {
  14.   String result = "";
  15.   for (int i = 0; i < count; i++) {
  16.  
  17.    result = result + symbol;
  18.      }
  19.  return result;    
  20.  }  
  21.  }
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