yzbzz147268 @ 2024-12-18 13:43:38
#include<bits/stdc++.h>
using namespace std;
int a[50050],b[50050],c[50050];
char a1[50000],b1[50000];
int main(){
cin>>a1>>b1;
int la=strlen(a1),lb=strlen(b1);
for(int i=1;i<=la;i++)
a[i]=a1[la-i]-'0';
for(int i=1;i<=lb;i++)
b[i]=b1[lb-i]-'0';
for(int i=1;i<=lb;i++)
for(int j=1;j<=la;j++)
c[i+j-1]+=a[j]*b[i];
for(int i=1;i<la+lb;i++){
if(c[i]>9){
c[i+1]+=c[i]/10;
c[i]%10;
}
}
int lc=la+lb;
while(c[lc]==0&&lc>1)
lc--;
for(int i=lc;i>=1;i--)
cout<<c[i];
return 0;
}```
by Terrible @ 2024-12-18 14:30:22
@yzbzz147268
c[i]%=10;
by yzbzz147268 @ 2024-12-19 13:35:33
@Terrible 谢谢大佬,关注了