Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 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 _5
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = 0;
  14. for (;;)
  15. {
  16. n = int.Parse(Console.ReadLine());
  17. if (1 <= n && n <= 100)
  18. {
  19. break;
  20. }
  21. else
  22. Console.WriteLine("ot 1 do 100");
  23. }
  24. #region MyRegion
  25. var str = new string(' ', n);
  26. Console.Write(str);
  27. Console.WriteLine(" | ");
  28. #endregion
  29. #region MyRegion
  30. for (int row = 1; row <= n; row++)
  31. {
  32. var spaces = new string(' ', n - row);
  33. Console.Write(spaces);
  34. var stars = new string('*', row);
  35. Console.Write(stars);
  36. Console.Write(" | ");
  37. Console.Write(stars);
  38.  
  39.  
  40. Console.WriteLine();
  41. }
  42.  
  43.  
  44. #endregion
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement