fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. vector<int>myints = {3, 55, 2, 7, 8};
  9. int total = 0;
  10. for (auto it = myints.begin(); it != myints.end(); ++it) {
  11. int x = int(log10(*it)) + 1;
  12. total = total * pow(10, x) + *it;
  13. }
  14. cout << total << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
355278