Advertisement
loter

vol.1

Nov 24th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 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 Triangle
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int size = int.Parse(Console.ReadLine());
  14. int point = 1;
  15. int sharp = (4 * size - 2) / 2;
  16. int empty = 1;
  17. Console.WriteLine(new string ('#', (4 * size + 1)));
  18. for (int row = 1; row <= size; row++)
  19. {
  20. if (row == (size / 2 + 1))
  21. {
  22. Console.Write(new string('.', point));
  23. Console.Write(new string('#', sharp));
  24. Console.Write(new string(' ', empty / 2 - 1));
  25. Console.Write("(@)");
  26. Console.Write(new string(' ', empty / 2 - 1));
  27. Console.Write(new string('#', sharp));
  28. Console.Write(new string('.', point));
  29. sharp-=2;
  30. point++;
  31. empty+= 2;
  32. Console.WriteLine();
  33. }
  34. else
  35. {
  36. Console.Write(new string('.', point));
  37. Console.Write(new string('#', sharp));
  38. Console.Write(new string(' ', empty));
  39. Console.Write(new string('#', sharp));
  40. Console.Write(new string('.', point));
  41. point++;
  42. sharp -= 2;
  43. empty += 2;
  44. Console.WriteLine();
  45. }
  46. }
  47. sharp = (4 * size - 2) / 2;
  48. for (int row = 1; row <= size; row++)
  49. {
  50. Console.Write(new string('.', point));
  51. Console.Write(new string('#', sharp));
  52. Console.Write(new string('.', point));
  53. point++;
  54. sharp-= 2;
  55. Console.WriteLine();
  56. }
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement