Advertisement
petromaxa

Untitled

Dec 29th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. using System;
  2.  
  3. class Task4
  4. {
  5. static void Main()
  6. {
  7. int N = int.Parse(Console.ReadLine());
  8. string firstHalfRow = new string ('.',N-2);
  9. string secondHalfRow = firstHalfRow.Insert(N / 2 - 1, "\\/");
  10. firstHalfRow=firstHalfRow.Insert(N/2-1,"/\\");
  11. string[] secondHalfOfTheCarper = new string[N / 2];
  12. secondHalfOfTheCarper[N/2-1] = secondHalfRow;
  13. Console.WriteLine(firstHalfRow);
  14. int j = N / 2;
  15. int p = N/2-2;
  16. for (int i = 1; i < N/2; i++,j++,p--)
  17. {
  18. if (i % 2 == 1)
  19. {
  20.  
  21. firstHalfRow = firstHalfRow.Insert(j," ");
  22. secondHalfRow = secondHalfRow.Insert(j," ");
  23. Console.WriteLine(firstHalfRow.Substring(i,N));
  24. secondHalfOfTheCarper[p] = secondHalfRow.Substring(i, N);
  25. }
  26. else
  27. {
  28. firstHalfRow = firstHalfRow.Insert(j, "/\\");
  29. Console.WriteLine(firstHalfRow.Substring(i , N));
  30. secondHalfRow = secondHalfRow.Insert(j, "\\/");
  31. secondHalfOfTheCarper[p] = secondHalfRow.Substring(i, N);
  32. }
  33. }
  34. for (int i = 0; i < N/2; i++)
  35. {
  36. Console.WriteLine(secondHalfOfTheCarper[i]);
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement