Advertisement
loter

vol.2

Nov 24th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 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. for (int col = 1; col <= point; col++)
  37. {
  38. Console.Write(".");
  39. }
  40. for (int col = 1; col <= sharp; col++)
  41. {
  42. Console.Write("#");
  43. }
  44. for (int i = 1; i <= empty; i++)
  45. {
  46. Console.Write(" ");
  47. }
  48. for (int col = 1; col <= sharp; col++)
  49. {
  50. Console.Write("#");
  51. }
  52. for (int col = 1; col <= point; col++)
  53. {
  54. Console.Write(".");
  55. }
  56. point++;
  57. sharp -= 2;
  58. empty += 2;
  59. Console.WriteLine();
  60. }
  61. }
  62. sharp = (4 * size - 2) / 2;
  63. for (int row = 1; row <= size; row++)
  64. {
  65. for (int col = 1; col <= point; col++)
  66. {
  67. Console.Write(".");
  68. }
  69. for (int col = 1; col <= sharp; col++)
  70. {
  71. Console.Write("#");
  72. }
  73. for (int col = 1; col <= point; col++)
  74. {
  75. Console.Write(".");
  76. }
  77. point++;
  78. sharp-= 2;
  79. Console.WriteLine();
  80. }
  81. }
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement