Advertisement
fbinnzhivko

Rocklq

Mar 17th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int size = int.Parse(Console.ReadLine());
  7.  
  8.         int outerDots = size;
  9.         int innerDots = size - 2;
  10.         Console.WriteLine("{0}*{1}*{0}", new string('.', outerDots), new string('*', innerDots));
  11.  
  12.         for (int i = 0; i < size / 2; i++)
  13.         {
  14.             outerDots -= 2;
  15.             innerDots += 4;
  16.             Console.WriteLine("{0}*{1}*{0}", new string('.', outerDots), new string('.', innerDots));
  17.  
  18.         }
  19.         Console.WriteLine("*{0}*{1}*{0}*", new string('.', size - 2), new string('.', size));
  20.  
  21.         innerDots = 1;
  22.         outerDots = size - 4;
  23.  
  24.         for (int i = 0; i < size / 2-1; i++)
  25.         {
  26.             Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*",new string('.',outerDots),new string('.', innerDots),new string('.',size));
  27.  
  28.             innerDots += 2;
  29.             outerDots -= 2;
  30.         }
  31.        outerDots = size - 1;
  32.         innerDots = size;
  33.  
  34.         for (int i = 0; i < size - 1; i++)
  35.         {
  36.             Console.WriteLine("{0}*{1}*{0}", new string('.', outerDots), new string('.', innerDots));
  37.             outerDots--;
  38.             innerDots += 2;
  39.         }
  40.         Console.WriteLine("{0}", new string('*', 3 * size));
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement