Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. namespace Rhombus_of_stars
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8.  
  9. for (int row = 0; row < n; row++)
  10. {
  11.  
  12. Console.Write(new string(' ', n - row));
  13. for (int col = 0; col <= row; col++)
  14. {
  15. Console.Write('*');
  16. Console.Write(' ');
  17.  
  18. }
  19. Console.WriteLine();
  20. }
  21. for (int row = n - 1; row > 0; row--)
  22. {
  23. Console.Write(new string(' ', n - row));
  24. for (int col = 0; col < row; col++)
  25. {
  26. Console.Write('*');
  27. Console.Write(' ');
  28. }
  29. Console.WriteLine();
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement