fork download
  1. #include <iostream>
  2. #include<vector>
  3. #include<cmath>
  4. using namespace std;
  5. uint32_t toInt(vector<int> v)
  6. {
  7. uint32_t x=0;
  8. for(int i=0 ; i<v.size() ; i++)
  9. x+=v[i]*pow(10, v.size()-1-i);
  10.  
  11. return x;
  12. }
  13.  
  14. int main()
  15. {
  16. vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  17. cout << toInt(v) << endl; // displays: 123456787 (???)
  18. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
123456789