Advertisement
Pazzobg

Programming Basics / 6.DrawLoops / 21.RectangleStarsIn

Feb 28th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _6._21.RectangleWStarsIn
  4. {
  5.     class RecctangleStarsIn
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             Console.WriteLine(new string('%', 2*n));
  12.  
  13.             for (int i = 0; i < (n-1) / 2; i++)
  14.             {
  15.                 Console.WriteLine("%{0}%", new string (' ', (2*n)-2));
  16.             }
  17.             Console.WriteLine("%{0}**{0}%", new string (' ', n-2));
  18.  
  19.             for (int i = 0; i < (n - 1) / 2; i++)
  20.             {
  21.                 Console.WriteLine("%{0}%", new string(' ', (2 * n) - 2));
  22.             }
  23.             Console.WriteLine(new string('%', 2 * n));
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement