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