zh_stoqnov

Eclipse

Oct 24th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Eclipse
  4. {
  5. class Eclipse
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. string asterisk = "*";
  11. string frameAsterisk = new string('*', (2 * n) - 2);
  12. string frames = " " + frameAsterisk + " ";
  13. string dash = new string('/', (2 * n) - 2);
  14. string bridgeDash = new string('-', n - 1);
  15. string spaces = new string(' ', n - 1);
  16. string bridgeConnector = "";
  17. Console.WriteLine(frames + spaces + frames);
  18. for(int i = 0; i < n - 2; i++)
  19. {
  20. if(i == ((n - 2) / 2))
  21. {
  22. bridgeConnector = bridgeDash;
  23. }
  24. else
  25. {
  26. bridgeConnector = spaces;
  27. }
  28. Console.WriteLine("{0}{1}{0}{2}{0}{1}{0}", asterisk, dash, bridgeConnector);
  29. }
  30. Console.WriteLine(frames + spaces + frames);
  31.  
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment