Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Demo
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string firstLastRow = string.Format("{0}{1}{0}", new string('-', 4 * n / 2), new string('*', n));
- Console.WriteLine(firstLastRow);
- int ampersand = n + 2;
- for (int i = 1; i <= n / 2; i++)
- {
- Console.WriteLine("{0}{1}{2}{1}{0}", new string('-', (5 * n - (ampersand + i * 2)) / 2),
- new string('*', i),
- new string('&', ampersand));
- ampersand += 2;
- }
- for (int i = 1; i <= n / 2; i++)
- {
- Console.WriteLine("{0}**{1}**{0}", new string('-', n - i),
- new string('~', n * 5 - ((n - i) * 2 + 4)));
- }
- Console.WriteLine("{0}*{1}*{0}", new string('-', n / 2),
- new string('|', 5 * n - ((n / 2 * 2) + 2)));
- for (int i = n / 2; i > 0; i--)
- {
- Console.WriteLine("{0}**{1}**{0}", new string('-', n - i),
- new string('~', n * 5 - ((n - i) * 2 + 4)));
- }
- for (int i = n / 2; i > 0; i--)
- {
- ampersand -= 2;
- Console.WriteLine("{0}{1}{2}{1}{0}", new string('-', (5 * n - (ampersand + i * 2)) / 2),
- new string('*', i),
- new string('&', ampersand));
- }
- Console.WriteLine(firstLastRow);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment