SHARE
TWEET

Untitled

a guest Nov 15th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. in onemethod:
  2. public static void fancySquare(int n)
  3. {
  4.    for(int i = 1; i <= n; i++)
  5.    {
  6.       for(int j = 1; j <= n; j++)
  7.       {
  8.          if(j == 1 || j == n || i == j || i == 1 || i == n || i + j == n + 1)
  9.          {
  10.          System.out.print("*");
  11.            if(j == 1 && i == 1 || j == n && i == n)
  12.            {
  13.            System.out.print("@");
  14.            }
  15.          }
  16.          else
  17.          {
  18.          System.out.print(" ");
  19.          }  
  20.       }
  21.     System.out.println();
  22.    }
  23.    System.out.println()
RAW Paste Data
Top