Advertisement
fbinnzhivko

Magic Wand 1

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