Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class House
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- string star = "*";
- string dot = ".";
- int left = N / 2;
- int right = N / 2;
- for (int row = 0; row < ((N + 1) / 2) - 1; row++)
- {
- for (int col = 0; col < N; col++)
- {
- if(row == 0 && col == N /2)
- {
- Console.Write(star);
- }
- else if( row > 0 && col == left)
- {
- Console.Write(star);
- }
- else if (row > 0 && col == right)
- {
- Console.Write(star);
- }
- else
- {
- Console.Write(dot);
- }
- }
- Console.WriteLine();
- left--;
- right++;
- }
- Console.WriteLine(new string('*', N));
- for (int i = N / 2 + 1; i < N ; i++)
- {
- if( i == N - 1 )
- {
- Console.Write(new string('.', N / 4));
- Console.Write(new string('*', N - (N / 2) ));
- Console.WriteLine(new string('.', N / 4));
- }
- else
- {
- Console.WriteLine("{0}*{1}*{0}", new string('.', N / 4), new string('.', N - N / 2 - 2));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment