NedyalkoKikov

RhombusOFStarsV2

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