Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _00_ConsoleApp1
- {
- class Program
- {
- static void Main()
- {
- // Get user input
- var n = int.Parse(Console.ReadLine());
- string row1 = new string('*', n);
- string row2 = new string(' ', n - 2);
- string square = row1 + Environment.NewLine;
- for(int i = 2; i < n; i++)
- {
- square += "*" + row2 + "*" + Environment.NewLine;
- }
- square += row1;
- Console.WriteLine(square);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement