Advertisement
NikolaySpasovTriset

Rhombus

Oct 7th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. class RhombusOfStars
  4. {
  5. static void Main()
  6. {
  7. int num = int.Parse(Console.ReadLine());
  8. int x = 1;
  9. int y = 1;
  10.  
  11. for (int row = 0; row < num; row++)
  12. {
  13. Console.Write(new string(' ', num - x));
  14. x++;
  15. for (int i = 0; i <= row; i++)
  16. {
  17. Console.Write("* ");
  18. }
  19. Console.WriteLine();
  20. }
  21. for (int i = 0; i < num - 1; i++)
  22. {
  23. Console.Write(new string (' ', y));
  24. y++;
  25. for (int z = 0; z < num - (i + 1); z++)
  26. {
  27. Console.Write("* ");
  28. }
  29. Console.WriteLine();
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement