NedyalkoKikov

RhombusOFStars

May 2nd, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 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. for (int row = 0; row < n; row++)
  15. {
  16. Console.Write(new string(' ', n - row - 1));
  17. for (int col = 0; col <=row; col++)
  18. {
  19. Console.Write("* ");
  20. }
  21. Console.WriteLine();
  22. }
  23. for (int row = n-2; row >=0; row--)
  24. {
  25. Console.Write(new string(' ', n - row - 1));
  26. for (int col = 0; col <= row; col++)
  27. {
  28. Console.Write("* ");
  29. }
  30. Console.WriteLine();
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment