题目链接
其实是高精度与低精度乘法
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
string a,res;
int b;
cin>>a>>b;
reverse(a.begin(), a.end());
int c = 0;
for(int i = 0; i < a.size(); i++){
int u = a[i] - '0';
int t = u * b + c;
res += to_string(t % 10);
c = t / 10;
}
while(c != 0){
res +=to_string(c%10);
c /= 10;
}
reverse(res.begin(), res.end());
cout<<res<<endl;
return 0;
}