#include<iostream>
using namespace std;
const int N = 50000;
int arr[2*N];
int aa[N];
int bb[N];
int main(){
string a,b;
cin>>a>>b;
for(int i = a.length()-1;i>=0;i--){
aa[a.length()-i-1] = a.at(i)-'0';
}
for(int i = b.length()-1;i>=0;i--){
bb[b.length()-i-1] = b.at(i)-'0';
}
for(int i = 0 ;i<a.length();i++){
for(int j=0;j<b.length();j++){
arr[i+j] +=bb[j]*aa[i];
}
}
int len = a.length()+b.length();
for(int i = 0;i<=len;i++){
arr[i+1] += arr[i]/10;
arr[i]%=10;
}
while(!arr[len]){
len--;
}
if(len<0)
cout<<0;else
for(int i = len;i>=0;i--)
cout<<arr[i];
}
标签:aa,bb,高精度,int,AxB,--,length
From: https://www.cnblogs.com/tsqo/p/16888658.html