Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MagicWand
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int width = 3 * n + 2;
- // first line
- Console.WriteLine("{0}*{0}", new string('.', width / 2));
- // end of first line
- // second line
- int secondDots = width / 2 - 1;
- int secondinnerDots = 1;
- for (int i = 0; i < n / 2 + 1; i++)
- {
- Console.WriteLine("{0}*{1}*{0}", new string('.', secondDots), new string('.', secondinnerDots));
- secondDots--;
- secondinnerDots = secondinnerDots + 2;
- }
- // end of second line
- //third line
- Console.WriteLine("{0}{1}{0}", new string('*', n), new string('.', n + 2));
- // end third line
- //fourth line
- int fourtDots = 1;
- int innerFourtDots = width - 4;
- for (int i = 0; i < n / 2; i++)
- {
- Console.WriteLine("{0}*{1}*{0}", new string('.', fourtDots), new string('.', innerFourtDots));
- fourtDots++;
- innerFourtDots = innerFourtDots - 2;
- }
- // end fourth line
- //Five Magic Line
- int innerFiveDots = 0;
- int innerFiveSecondDots = 0;
- int outFiveDots = n / 2 - 1;
- for (int i = 0; i < n/2-1; i++)
- {
- Console.Write("{0}*{1}*{2}", new string('.', outFiveDots), new string('.', n / 2),new string ('.',innerFiveDots));
- Console.Write("*{0}*",new string ('.',n));
- Console.Write("{2}*{1}*{0}", new string('.', outFiveDots), new string('.', n / 2), new string('.', innerFiveSecondDots));
- innerFiveSecondDots++;
- innerFiveDots++;
- outFiveDots--;
- Console.WriteLine();
- }
- Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*",new string ('.',n/2),new string ('.',n/2-1),new string ('.',n));
- // before last
- Console.WriteLine("{0}{1}*{2}*{1}{0}", new string ('*',n/2+1), new string ('.',n/2),new string ('.',n));
- // End of wand
- for (int i = 0; i < n; i++)
- {
- Console.WriteLine("{0}*{0}*{0}", new string ('.',n));
- }
- Console.WriteLine("{0}{1}{0}", new string('.', n), new string ('*',n+2));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement