Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine("{0}{1}{0}", new string('-', n/2), new string ('*', n+2));
- for (int i = 1; i <= n; i++)
- {
- Console.WriteLine("{0}*{1}*{0}", new string('-', n/2), new string ('-', n));
- }
- int counterLines = n/2;
- int counterStars = 1;
- int counterMiddleLines = n;
- for (int i = 1; i < n/2; i++)
- {
- counterLines -=1;
- counterStars += 2;
- counterMiddleLines -= 2;
- Console.WriteLine("{0}{1}{2}{1}{0}", new string('-', counterLines), new string('*', counterStars), new string('-', counterMiddleLines));
- }
- Console.WriteLine("{0}-{0}", new string ('*', n));
- int firstLines = n - n;
- int middle = 1;
- int stars = n;
- for (int i = 1; i < n/2+1; i++)
- {
- firstLines += 1;
- stars -= 2;
- middle += 2;
- Console.WriteLine("{0}{1}{2}{1}{0}", new string ('-', firstLines), new string('*', stars), new string('-', middle));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement