Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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 ConsoleApplication37
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var n = int.Parse(Console.ReadLine());
  14. var stars = 1;
  15. var spaces = n - 1;
  16. Console.Write(new string(' ',n+1) );
  17. Console.WriteLine("|");
  18.  
  19. for (int i = 0; i <n; i++)
  20. {
  21.  
  22. Console.Write(new string(' ',spaces));
  23. Console.Write(new string('*', stars));
  24. Console.Write(" | ");
  25. Console.WriteLine(new string('*', stars));
  26.  
  27. stars += 1;
  28. spaces -= 1;
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement