Advertisement
Guest User

Untitled

a guest
Oct 12th, 2016
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 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 Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. for (int rows = 1; rows <= n; rows++)
  15. {
  16. for (int col = 1; col <= n - rows; col++)
  17. {
  18. Console.Write(" ");
  19. }
  20. Console.Write("*");
  21. for (int col = 1; col <= rows - 1; col++)
  22. {
  23. Console.Write(" *");
  24. }
  25. Console.WriteLine();
  26. }
  27. for (int rows = 2; rows <= n; rows++)
  28. {
  29. for (int col = 1; col <= rows-1; col++)
  30. {
  31. Console.Write(" ");
  32. }
  33. Console.Write("*");
  34. for (int col = 1; col <= n-rows; col++)
  35. {
  36. Console.Write(" *");
  37. }
  38. Console.WriteLine();
  39.  
  40. }
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement