Advertisement
GStepanov

Untitled

Nov 7th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 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 Axes
  8. {
  9. class Program
  10. {
  11. static void Main()
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. var leftDashes = 3 * n;
  15. var rightDashes = (2 * n) - 2;
  16. var middleDashes = 1;
  17. var startingStars = (3 * n) + 1;
  18. var middleDashes1 = n - 1;
  19. var middleDashes2 = n - 1;
  20. var middleDashes3 = n - 1;
  21.  
  22. Console.WriteLine("{0}**{1}", new string('-', leftDashes), new string('-', rightDashes));
  23.  
  24. for (int i = 0; i < n - 1; i++)
  25. {
  26. Console.WriteLine("{0}*{1}*{2}", new string('-', leftDashes), new string('-', middleDashes), new string('-', rightDashes - 1));
  27. middleDashes++;
  28. rightDashes--;
  29. }
  30.  
  31. for (int i = 0; i < n / 2; i++)
  32. {
  33. Console.WriteLine("{0}{1}*{1}", new string('*', startingStars), new string('-', middleDashes1));
  34. }
  35.  
  36. for (int i = 0; i < (n / 2) /* - 1 */; i++)
  37. {
  38. if (i + 1 == n/2)
  39. {
  40. Console.WriteLine("{0}*{1}*{2}", new string('-', leftDashes - i), new string('*', middleDashes2 + i * 2), new string('-', middleDashes3 - i));
  41. }
  42. else
  43. {
  44. Console.WriteLine("{0}*{1}*{2}", new string('-', leftDashes - i), new string('-', middleDashes2 + i * 2), new string('-', middleDashes3 - i));
  45. //middleDashes2++;
  46. //middleDashes3--;
  47. }
  48.  
  49. }
  50.  
  51. // Console.WriteLine("{0}*{1}*{2}", new string('-', leftDashes), new string('*', middleDashes2), new string('-', middleDashes3));
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement