fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <sstream>
  4. #include <iterator>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. vector <int> num = {1, 3, 4, 5};
  12. stringstream ss;
  13. copy(num.rbegin(), num.rend(), ostream_iterator<int>(ss, ""));
  14. int res;
  15. ss >> res;
  16. cout << res;
  17. return 0;
  18. }
Success #stdin #stdout 0s 4412KB
stdin
Standard input is empty
stdout
5431