Advertisement
KlimentHristov

Figure.Sunlight

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