Advertisement
Atanasov_88

Roklia

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