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