Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Square
- {
- class Sqare
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- for (int row = 0; row < n; row++)
- {
- for (int col = 0; col < n; col++)
- {
- if(row == 0 || row == n -1)
- {
- Console.Write("*");
- }
- else if(col == 0 || col == n -1)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write("-");
- }
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment