grach

SquareOfStars

Jul 7th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SquareOfStars
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var a = int.Parse(Console.ReadLine());
  14.             Console.Write(new string('*', a));
  15.             Console.WriteLine();
  16.  
  17.             for (int i = 0; i < a - 2; i++)
  18.                 {
  19.             Console.WriteLine("*{0}*", new string(' ', a - 2));
  20.                 }
  21.                 for (int i = 0; i < a; i++)
  22.                 {
  23.                     Console.Write("*");
  24.                 }
  25.                  Console.WriteLine();  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment