我的3066都是下划线...

台风沙德尔(目标1650题)  •  2个月前



评论:

代码呢


董睿腾  •  1个月前

不信


董睿腾  •  1个月前

include<bits/stdc++.h>

using namespace std; int x[250],y[250],z[500]; int main(){

int t;
cin>>t;
string a,b;
while(t--){
	cin>>a>>b;
	memset(x,0,sizeof(x));
	memset(y,0,sizeof(y));
	memset(z,0,sizeof(z));
	int la=a.size(),lb=b.size();
	int lc=la+lb;
	for(int i=la-1;i>=0;i--){
		x[la-i]=a[i]-'0';
	}
	for(int i=lb-1;i>=0;i--){
		y[lb-i]=b[i]-'0';
	}
	for(int i=1;i<=lb;i++){
		for(int j=1;j<=la;j++){
			z[i+j-1]+=x[j]*y[i];
			z[i+j]+=z[i+j-1]/10;
			z[i+j-1]%=10;
		}
	}
	while(z[lc]==0&&lc>1){
		lc--;
	}
	for(int i=lc;i>=1;i--){
		cout<<z[i];
	}
	cout<<endl;
}

return 0;

}


sunwukong  •  17天前

用高精度


wyjb(掉榜六版)  •  16天前