Guest User

Untitled

a guest
Oct 30th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 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 Axe
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int leftdashes = 3 * n;
  15. int inDashes = 0;
  16. int allbeforeall = leftdashes + inDashes + +2;
  17. int all = 5 * n;
  18. int rightDashes = all - allbeforeall;
  19.  
  20. for (int i = 0; i < n; i++)
  21. {
  22. Console.Write(new string('-', leftdashes));
  23. Console.Write("*");
  24. Console.Write(new string('-', inDashes));
  25. Console.Write("*");
  26. Console.Write(new string('-', rightDashes));
  27. Console.WriteLine();
  28. inDashes++;
  29. rightDashes--;
  30. }
  31. for (int i = 0; i < n/2; i++)
  32. {
  33. Console.Write(new string('*', leftdashes));
  34. Console.Write("*");
  35. Console.Write(new string('-', inDashes-1));
  36. Console.Write("*");
  37. Console.Write(new string('-', rightDashes+1));
  38. Console.WriteLine();
  39. }
  40. if(n%2 ==0)
  41. for (int i = 0; i < n/2-1; i++)
  42. {
  43.  
  44. Console.Write(new string('-', leftdashes));
  45. Console.Write("*");
  46. Console.Write(new string('-', inDashes-1));
  47. Console.Write("*");
  48. Console.Write(new string('-', rightDashes+1));
  49. Console.WriteLine();
  50. inDashes += 2 ;
  51. rightDashes--;
  52. leftdashes--;
  53. if (i == n / 2 - 2)
  54. {
  55.  
  56. Console.Write(new string('-', leftdashes));
  57. Console.Write("*");
  58. Console.Write(new string('*', inDashes-1));
  59. Console.Write("*");
  60. Console.Write(new string('-', rightDashes +1));
  61. Console.WriteLine();
  62. }
  63.  
  64. }
  65. else
  66. for (int i = 0; i < n / 2 - 1; i++)
  67. {
  68.  
  69. Console.Write(new string('-', leftdashes));
  70. Console.Write("*");
  71. Console.Write(new string('-', inDashes -1));
  72. Console.Write("*");
  73. Console.Write(new string('-', rightDashes+1));
  74. Console.WriteLine();
  75. inDashes += 2;
  76. rightDashes--;
  77. leftdashes--;
  78. if (i == n / 2 -2)
  79. {
  80.  
  81. Console.Write(new string('-', leftdashes));
  82. Console.Write("*");
  83. Console.Write(new string('*', inDashes-1));
  84. Console.Write("*");
  85. Console.Write(new string('-', rightDashes+1));
  86. Console.WriteLine();
  87. }
  88.  
  89. }
  90.  
  91.  
  92.  
  93. }
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment