Advertisement
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 HomeWorkCoding101
- {
- class SqareOfStars
- {
- static void Main(string[] args)
- {
- //First part
- int N = int.Parse(Console.ReadLine());
- //Write the first row
- string row = new string('*' , N);
- Console.WriteLine(row);
- //Write inner rows
- for(int times = 0; times < N - 2; times++)
- {
- //string currentRow = "*" + new string(' ', N - 2) + "*";
- //Console.WriteLine(currentRow);
- string spaces = new string(' ' , N - 2);
- Console.WriteLine("*{0}*" , spaces);
- }
- //Write the first row again
- Console.WriteLine(row);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement