Guest User

Untitled

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