Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7.  
  8.  
  9. int n = int.Parse(Console.ReadLine());
  10. int stars = 1;
  11. if (n % 2 == 0)
  12. {
  13. stars = 2;
  14. }
  15. int dashes = (n - stars) / 2;
  16. for (int i = 0; i < (n + 1) / 2; i++)
  17. {
  18. Console.WriteLine("{0}{1}{0}", new string('-', dashes), new string('*', stars));
  19. stars += 2;
  20. dashes--;
  21. }
  22. for (int i = 0; i < n / 2; i++)
  23. {
  24. Console.WriteLine("|{0}|",new string('*',n - 2));
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement