Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace House
- {
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- for (int i = 1; i <= (n + 1) / 2; i++)
- {
- for (int j = 0; j < (n + 1) / 2 - i; j++)
- {
- Console.Write('-');
- }
- if (n % 2 == 1)
- {
- Console.Write('*');
- }
- else
- {
- Console.Write("**");
- }
- for (int k = 1; k < i; k++)
- {
- Console.Write("**");
- }
- for (int j = 0; j < (n + 1) / 2 - i; j++)
- {
- Console.Write('-');
- }
- Console.WriteLine();
- }
- for (int i = 0; i < n / 2; i++)
- {
- Console.Write('|');
- for (int x = 0; x < n - 2; x++)
- {
- Console.Write('*');
- }
- Console.WriteLine('|');
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment