Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _13_03
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int width = 2 * n;
- int height = n;
- int hutsSize = n / 2;
- string huts = new string('^', hutsSize);
- int roofSize = width - 4 - hutsSize * 2;
- string roof = new string('_', roofSize);
- Console.WriteLine($"/{huts}\\{roof}/{huts}\\");
- int sizeOfBody = height - 3;
- string fillSpace = new string(' ', width - 2);
- for (int i = 0; i < sizeOfBody; i++)
- {
- Console.WriteLine($"|{fillSpace}|");
- }
- var floorFillSpaceSize = ((width - 2) - roofSize)/2;
- string floorFillSpace = new string(' ', floorFillSpaceSize);
- Console.WriteLine($"|{floorFillSpace}{roof}{floorFillSpace}|");
- string lastFloor = new string('_', hutsSize);
- string lastFloorSpaces = new string(' ',roofSize);
- Console.WriteLine($"\\{lastFloor}/{lastFloorSpaces}\\{lastFloor}/");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement