zh_stoqnov

Wine glass

Oct 29th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Wine_Glass
  4. {
  5. class WineGlass
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. string dotHolder = new string('.', n / 2 - 1);
  11. string twoVertLines = new string('|', 2);
  12. string dash = new string('-', n);
  13. for (int i = 0 ; i < n / 2; i++)
  14. {
  15. string slash = @"\";
  16. string slash2 = "/";
  17. string asterisk = new string('*', n - 2 - 2 * i);
  18. string dot = new string('.', i);
  19. Console.WriteLine("{0}{1}{2}{3}{0}", dot, slash, asterisk, slash2);
  20. }
  21. if (n >= 12)
  22. {
  23. for(int i = 0; i < n / 2 - 2; i++)
  24. {
  25. Console.WriteLine("{0}{1}{0}", dotHolder, twoVertLines, dotHolder);
  26. }
  27. for(int i = 0; i < 2; i++)
  28. {
  29. Console.WriteLine(dash);
  30. }
  31. }
  32. else
  33. {
  34. for(int i = 0; i < n / 2 - 1; i++)
  35. {
  36. Console.WriteLine("{0}{1}{0}", dotHolder, twoVertLines, dotHolder);
  37. }
  38. Console.WriteLine(dash);
  39. }
  40. Console.ReadKey(true);
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment