how can i concatenate value from a int vector to long long int i found a way i don't know it is the good way or not
Code:#include <iostream> #include <vector> using namespace std; int main(){ vector<int> a = { 4, 5, 8, 7, 4, 5, 1 }; long long int g = 0; const int Cn = 10; int x = 0; int szii = a.size(); for (int i = 0; i < szii; i++){ if (i == 0){ g = a[i]; } else { x = a[i]; g = Cn * g + x; } } return 0; }




Reply With Quote
