Advertisement
SenpaiZero

Pyramid

Sep 27th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Espinola_JohnCarl_03LabExc1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. DrawPyramid(20);
  10. }
  11.  
  12. static void DrawPyramid(int n)
  13. {
  14. for (int i = 1; i <= n; i++)
  15. {
  16. for (int j = i; j <= n; j++)
  17. {
  18. Console.Write(" ");
  19. }
  20. for (int k = 1; k <= 2 * i - 1; k++)
  21. {
  22. Console.Write("*" + " ");
  23. }
  24. Console.WriteLine();
  25. }
  26. }
  27. }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement