zh_stoqnov

Sunglasses

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