Advertisement
dobroslav_atanasov

BurjAlArab

Nov 24th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 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 _21.BurjAlArab
  8. {
  9. class BurjAlArab
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int width = 2 * n + 2;
  15. int high = 5 * n - 2;
  16.  
  17. for (int i = 1; i <= n / 2; i++)
  18. {
  19. Console.WriteLine("|");
  20. }
  21. int space = 0;
  22. for (int i = 1; i <= n - 1; i++)
  23. {
  24. Console.WriteLine("|{0}\\", new string(' ', space));
  25. space++;
  26. }
  27. int star = n - 1;
  28. for (int i = 1; i <= n + 2; i++)
  29. {
  30. Console.WriteLine("|{0}\\", new string('*', star));
  31. star++;
  32. }
  33. for (int i = 1; i <= n + 1; i++)
  34. {
  35. Console.WriteLine("|{0}|", new string('*', 2 * n));
  36. }
  37. star--;
  38. for (int i = 1; i <= n - 2; i++)
  39. {
  40. Console.WriteLine("|{0}/", new string('*', star));
  41. star--;
  42. }
  43. Console.WriteLine("{0}", new string('-', width));
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement