Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 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 RhombusOfStars
  8. {
  9. class RhombusOfStars
  10. {
  11. static void Main()
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14.  
  15. for (int row = 1; row <= n; row++)
  16. {
  17. for (int space = 0; space <= n- row; space++)
  18. {
  19. Console.Write(' ');
  20. }
  21. for (int stars = 0; stars < row; stars++)
  22. {
  23. Console.Write("* ");
  24. }
  25. Console.WriteLine();
  26. }
  27.  
  28. for (int row = 1; row <= n; row++)
  29. {
  30. for (int space = 1; space <= row; space++)
  31. {
  32. Console.Write(" ");
  33. }
  34. for (int stars = 0; stars < n - row; stars++)
  35. {
  36. Console.Write("* ");
  37. }
  38. Console.WriteLine();
  39. }
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement