Advertisement
Guest User

Untitled

a guest
Jul 12th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 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 star
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. /*
  14. int width = 10;
  15. int a = 0;
  16. int b = width / 2;
  17. int j = 1;
  18. while (a < width)
  19. {
  20. for (int i = 0; i < b; i++)
  21. {
  22. Console.Write(" ");
  23. }
  24. for (int h = 0; h < j; h++)
  25. {
  26. Console.Write("*");
  27. }
  28. Console.WriteLine();
  29. j += 2;
  30. a += 2;
  31. b -= 1;
  32. }
  33. */
  34.  
  35. int width = 70;
  36. int topHeight = width / 6;
  37. int a = 0;
  38. int c = width / 2;
  39. int e = 1;
  40. while(a < topHeight)
  41. {
  42. for (int b = 0; b < c; b++)
  43. {
  44. Console.Write(" ");
  45. }
  46. for (int d = 0; d < e; d++)
  47. {
  48. Console.Write("*");
  49. }
  50. Console.WriteLine();
  51. c -= 1;
  52. e += 2;
  53. a += 1;
  54. }
  55.  
  56. int f = 0;
  57. int h = 0;
  58. int j = width;
  59. int midHeight = width / 8;
  60. while(f < midHeight)
  61. {
  62. for(int g = 0; g < h; g++)
  63. {
  64. Console.Write(" ");
  65. }
  66. for(int i = 0; i < j; i++)
  67. {
  68. Console.Write("*");
  69. }
  70. Console.WriteLine();
  71. h += 2;
  72. j -= 4;
  73. f += 1;
  74. }
  75.  
  76. int k = 0;
  77. int botHeight = width / 12;
  78. double m = midHeight * 2;
  79. double o = width - (midHeight * 4);
  80. while(k < botHeight)
  81. {
  82. for (int l = 0; l < m; l++)
  83. {
  84. Console.Write(" ");
  85. }
  86. for (int n = 0; n < o; n++)
  87. {
  88. Console.Write("*");
  89. }
  90. Console.WriteLine();
  91. m -= 0.5;
  92. o += 1;
  93. k += 1;
  94. }
  95.  
  96. int p = 0;
  97. int legHeight = width / 6;
  98. double r = m;
  99. double t = width/2 - m -1;
  100. double v = 1;
  101. double x = width/2 - m -1;
  102. while(p < legHeight)
  103. {
  104. for (int q = 0; q < r; q++)
  105. {
  106. Console.Write(" ");
  107. }
  108. for (int s = 0; s < t; s++)
  109. {
  110. Console.Write("*");
  111. }
  112. for (int u = 0; u < v; u++)
  113. {
  114. Console.Write(" ");
  115. }
  116. for (int w = 0; w < x; w++)
  117. {
  118. Console.Write("*");
  119. }
  120. Console.WriteLine();
  121. r -= 0.5;
  122. t -= 2;
  123. v += 5;
  124. x -= 2;
  125. p += 1;
  126. }
  127. Console.ReadLine();
  128. }
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement