Guest User

Untitled

a guest
Nov 21st, 2014
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. int n = 5;
  8. Console.WriteLine("{0}{1}{0}", new string('-', n / 2), '*');
  9.  
  10. for (int i = 1; i < n - 2; i++)
  11. {
  12. Console.WriteLine("{0}{1}{2}{1}{0}", new string('-', n / 2 - 1), '*', '-');
  13. if (i < n - 4)
  14. {
  15. Console.WriteLine("{0}{1}{2}{1}{0}", '-', '*', new string('-', n / 2 ), '*', '-');
  16. }
  17. if (i < n - 3)
  18. {
  19. Console.WriteLine("{0}{1}{0}", '*', new string('-', n - 2), '-');
  20. break;
  21. }
  22. }
  23.  
  24. for (int i = 1; i < n - 2; i++)
  25. {
  26. if (i < n - 3)
  27. {
  28. if (i < n - 4)
  29. Console.WriteLine("{0}{1}{2}{1}{0}", '-', '*', new string('-', n / 2), '*', '-');
  30. }
  31. {
  32. Console.WriteLine("{0}{1}{2}{1}{0}", new string('-', n / 2 - 1), '*', '-');
  33. break;
  34. }
  35. }
  36.  
  37. Console.WriteLine("{0}{1}{0}", new string('-', n / 2), '*');
  38. Console.ReadKey();
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment