Advertisement
lubaka

Untitled

Dec 11th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _13_03
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int width = 2 * n;
  15. int height = n;
  16. int hutsSize = n / 2;
  17. string huts = new string('^', hutsSize);
  18. int roofSize = width - 4 - hutsSize * 2;
  19. string roof = new string('_', roofSize);
  20.  
  21. Console.WriteLine($"/{huts}\\{roof}/{huts}\\");
  22. int sizeOfBody = height - 3;
  23. string fillSpace = new string(' ', width - 2);
  24. for (int i = 0; i < sizeOfBody; i++)
  25. {
  26. Console.WriteLine($"|{fillSpace}|");
  27. }
  28. var floorFillSpaceSize = ((width - 2) - roofSize)/2;
  29. string floorFillSpace = new string(' ', floorFillSpaceSize);
  30. Console.WriteLine($"|{floorFillSpace}{roof}{floorFillSpace}|");
  31.  
  32. string lastFloor = new string('_', hutsSize);
  33. string lastFloorSpaces = new string(' ',roofSize);
  34. Console.WriteLine($"\\{lastFloor}/{lastFloorSpaces}\\{lastFloor}/");
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement