Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class SquareOfStars
- {
- static void Main(string[] args)
- {
- int size = int.Parse(Console.ReadLine());
- string firstLastRow = new string('*', size);
- string middleRow = $"*{new string(' ', size - 2)}*";
- Console.WriteLine(firstLastRow);
- for (int counter = 0; counter < size - 2; counter++)
- {
- Console.WriteLine(middleRow);
- }
- Console.WriteLine(firstLastRow);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement