Advertisement
Atanasov_88

The Sunlight

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