vector<int> Div(vector<int>& A, int& B) { vector<int>C; int T = 0;//除数 for (int i = A.size() - 1; i >= 0; i--)//注意,除法模拟是从最高位开始的 { T = T * 10 + A[i];//更新除数 C.push_back(T / B); T %= B; } reverse(C.begin(), C.end());//反转C for (int i = C.size() - 1; C[i] == 0; i--)//滤掉前导的零 C.pop_back(); return C; }
标签:大数,int,back,整数,--,vector,模板,size From: https://www.cnblogs.com/WKWKSL/p/17353832.html