📜  C++ 将数字向量转换为整数 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:55.044000             🧑  作者: Mango

代码示例2
// Convert integer to vector of digits
vector int_to_vector(long long n) { 
    vector vec;
    while (n != 0) {
        vec.push_back(n%10);
        n /= 10;
    }
    reverse(vec.begin(), vec.end());
    return vec;
}