Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Week3
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. int n = int.Parse(Console.ReadLine());
  11. for (int row = 1; row <= n; row++)
  12. {
  13. for (int col = 1; col <= n - row; col++)
  14. {
  15. Console.Write(" ");
  16. }
  17. for (int col = 0; col < row; col++)
  18. {
  19. Console.Write("* ");
  20. }
  21. Console.WriteLine();
  22. }
  23.  
  24. for (int row = 1; row <= n - 1; row++)
  25. {
  26. Console.Write(new string(' ', row));
  27. for (int i = n - 1; i > row - 1; i--)
  28. {
  29. Console.Write("* ");
  30. }
  31. Console.WriteLine();
  32. }
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement