aggressiveviking

Untitled

Feb 8th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06.RhombusOfStars
  4. {
  5. class RhombusOfStars
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10.  
  11. int columnCount = 1;
  12. for (int row = 0; row < n - 1; row++)
  13. {
  14. Console.Write(new string(' ', n - columnCount));
  15.  
  16. for (int col = 0; col < columnCount; col++)
  17. {
  18. Console.Write("* ");
  19. }
  20.  
  21. Console.WriteLine();
  22. columnCount++;
  23. }
  24.  
  25. for (int col = 0; col < n; col++)
  26. {
  27. Console.Write("* ");
  28. }
  29. Console.WriteLine();
  30.  
  31. columnCount = n - 1;
  32. for (int row = 0; row < n - 1; row++)
  33. {
  34. Console.Write(new string(' ', n - columnCount));
  35.  
  36. for (int col = 0; col < columnCount; col++)
  37. {
  38. Console.Write("* ");
  39. }
  40.  
  41. Console.WriteLine();
  42. columnCount--;
  43. }
  44.  
  45. }
  46. }
  47. }
Add Comment
Please, Sign In to add comment