fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int test, ile;
  8. int[] tablica;
  9.  
  10. test = Convert.ToInt32(Console.ReadLine());
  11. for (int i=0; i< test; i++)
  12. {
  13. ile = Convert.ToInt32(Console.ReadLine());
  14. tablica = new int[ile];
  15. for (int j = 0; j < ile; j++)
  16. {
  17. tablica[j] = Convert.ToInt32(Console.ReadLine());
  18. }
  19. for (int j=0; j<ile; j++)
  20. {
  21. if (j%2 != 0)
  22. {
  23. Console.Write(tablica[j]+" ");
  24. }
  25. }
  26. for (int j = 0; j < ile; j++)
  27. {
  28. if (j%2 == 0)
  29. {
  30. Console.Write(tablica[j]+" ");
  31. }
  32. }
  33. Console.Write('\n');
  34. }
  35. }
  36. }
Success #stdin #stdout 0.05s 23984KB
stdin
2 
4
 1
 2
 3
 5
3
 9
 8
 7 
stdout
2 5 1 3 
8 9 7