fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. vector <int> a;
  8. int b;
  9. while (cin>>b)
  10. {
  11. a.push_back(b);
  12. }
  13. for (int i = 0; i<a.size()/2; i++)
  14. {
  15. cout<<a[i] + a[a.size()-i-1]<<" ";
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 3416KB
stdin
15 7 6 9
stdout
24 13