Advertisement
loter

vol.3

Nov 24th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 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. for (int col = 1; col <= point; col++)
  23. {
  24. Console.Write(".");
  25. }
  26. for (int col = 1; col <= sharp; col++)
  27. {
  28. Console.Write("#");
  29. }
  30. for (int col = 1; col <= empty / 2 - 1; col++)
  31. {
  32. Console.Write(" ");
  33. }
  34. Console.Write("(@)");
  35. for (int col = 1; col <= empty / 2 - 1; col++)
  36. {
  37. Console.Write(" ");
  38. }
  39. for (int col = 1; col <= sharp; col++)
  40. {
  41. Console.Write("#");
  42. }
  43. for (int col = 1; col <= point; col++)
  44. {
  45. Console.Write(".");
  46. }
  47. sharp-=2;
  48. point++;
  49. empty+= 2;
  50. Console.WriteLine();
  51. }
  52.  
  53. else
  54. {
  55. for (int col = 1; col <= point; col++)
  56. {
  57. Console.Write(".");
  58. }
  59. for (int col = 1; col <= sharp; col++)
  60. {
  61. Console.Write("#");
  62. }
  63. for (int i = 1; i <= empty; i++)
  64. {
  65. Console.Write(" ");
  66. }
  67. for (int col = 1; col <= sharp; col++)
  68. {
  69. Console.Write("#");
  70. }
  71. for (int col = 1; col <= point; col++)
  72. {
  73. Console.Write(".");
  74. }
  75. point++;
  76. sharp -= 2;
  77. empty += 2;
  78. Console.WriteLine();
  79. }
  80. }
  81. sharp = (4 * size - 2) / 2;
  82. for (int row = 1; row <= size; row++)
  83. {
  84. for (int col = 1; col <= point; col++)
  85. {
  86. Console.Write(".");
  87. }
  88. for (int col = 1; col <= sharp; col++)
  89. {
  90. Console.Write("#");
  91. }
  92. for (int col = 1; col <= point; col++)
  93. {
  94. Console.Write(".");
  95. }
  96. point++;
  97. sharp-= 2;
  98. Console.WriteLine();
  99. }
  100. }
  101. }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement