fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int t, n;
  8. int tab[101];
  9. int k =0;
  10.  
  11. cin >> t;
  12. for(int i = 0; i < t; i++)
  13. {
  14. int x =0;
  15. while(cin >> n && n <=100)
  16. {
  17. tab[x] = n;
  18.  
  19. x++;
  20. k =x;
  21. }
  22.  
  23. for (int i = 2; i < k ;)
  24. {
  25. cout << tab[i] << " " ;
  26. i +=2;
  27.  
  28. }
  29.  
  30. for (int i = 1; i < k ;)
  31. {
  32. cout << tab[i] << " " ;
  33. i +=2;
  34. }
  35. cout << endl;
  36.  
  37.  
  38. }
  39.  
  40. return 0;
  41. }
  42.  
Success #stdin #stdout 0.01s 5496KB
stdin
Standard input is empty
stdout
Standard output is empty