fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector <double> s;
  7. vector <double> l;
  8. double a,n;
  9. while(cin>>a)
  10. {
  11. s.push_back(a);
  12. }
  13. n=s.size()/2;
  14. for(int i=0;i<n;i++)
  15. {
  16. l.push_back(s.at(i));
  17. l.push_back(s.at(i+n));
  18. }
  19. for(int i=0;i<l.size();i++)
  20. {
  21. cout<<l.at(i)<<" ";
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 16064KB
stdin
1 2 3 4 5 6


stdout
1 4 2 5 3 6