Advertisement
Guest User

Untitled

a guest
May 28th, 2017
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 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 _01.X
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14.  
  15. int n = int.Parse(Console.ReadLine());
  16. var spaces = n;
  17.  
  18. // горна част
  19.  
  20. // spaces on left
  21. for (var i = 0; i < (n / 2) + 1; i++) // 2 , 3 , 4 , 5 , 6 ....
  22. {
  23. Console.Write(new string('/', i));
  24.  
  25. //първи х
  26. Console.Write("x");
  27.  
  28. // spaces between x- s /// towa var6i rabota
  29. spaces = spaces - 2;
  30. if (spaces < 0)
  31. {
  32. break;
  33. }
  34. Console.Write(new string('_', spaces));
  35.  
  36. // втори х
  37. Console.Write("x");
  38. // нов ред
  39. Console.WriteLine();
  40.  
  41.  
  42. }
  43.  
  44. Console.WriteLine();
  45.  
  46. // долна част
  47.  
  48. var newspaces = 0;
  49.  
  50. for (var k = n ; n > 0; k--)
  51. {
  52. newspaces = k ;
  53. Console.Write(new string('/' , newspaces));
  54. Console.Write("x");
  55.  
  56.  
  57.  
  58. // Console.Write("x");
  59. Console.WriteLine();
  60.  
  61.  
  62. }
  63.  
  64.  
  65.  
  66.  
  67. Console.WriteLine();
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. }
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement