Advertisement
WindFell

Square Of Stars

Oct 7th, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. class SquareOfStars
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         int size = int.Parse(Console.ReadLine());
  8.  
  9.         string firstLastRow = new string('*', size);
  10.         string middleRow = $"*{new string(' ', size - 2)}*";
  11.  
  12.         Console.WriteLine(firstLastRow);
  13.  
  14.         for (int counter = 0; counter < size - 2; counter++)
  15.         {
  16.             Console.WriteLine(middleRow);
  17.         }
  18.  
  19.         Console.WriteLine(firstLastRow);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement