c++版本的大数乘法
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<set>
#include<cmath>
#include<cstring>
#include<stack>
#include<map>
using namespace std;
string mul(string a,string b){
string c(a.length() + b.length(),'0');
for(int i = a.length() - 1;i >= 0;i--){
for(int j = b.length() - 1;j >= 0;j--){
int t = (a[i] - '0') * (b[j] - '0');
t += c[i + j + 1] - '0';
c[i + j + 1] = (t % 10) + '0';
c[i + j] = (t / 10 + (c[i + j]) - '0') + '0';
}
}
return c.substr(c.find_first_not_of("0"));
}
int main(){
cout << mul("120","30");
return 0;
}