desislava777

drow8

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