居然Tommy @ 2022-09-16 17:58:17
#include<iostream>
using namespace std;
int main()
{
long long a,b;
cin>>a>>b;
cout<<a*b;
return 0;
}
by liangbowen @ 2022-09-16 18:00:32
数据范围是
by NightStriker @ 2022-09-16 18:13:57
上楼过于直接
by Vanishing_Stars @ 2022-09-16 18:15:18
@居然Tommy 我前面这题也没过,发现数组开小了,本来想提醒你一下的,没想到你的程序如此简单粗暴哇哈哈
by Vanishing_Stars @ 2022-09-16 18:17:19
@居然Tommy
print(int(input())*int(input()))
楼上上上说的不错,给你安利python的代码,这种高精的直接水好吧
by luyixuan123 @ 2022-09-16 18:23:52
@CODE_SUPERVISOR 收到哈哈
by KarmaticEnding @ 2022-09-16 19:14:23
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
char a1[2000],b1[2000];
cin>>a1;
cin>>b1;
int lena=strlen(a1);int lenb=strlen(b1);
int a[2000],b[2000],c[4000],i,j,x;
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
memset(c,0,sizeof(c));
for(i=0;i<lena;i++) a[lena-i-1]=a1[i]-48;
for(i=0;i<lenb;i++) b[lenb-i-1]=b1[i]-48;
for(i=0;i<lena;i++){
x=0;
for(j=0;j<lenb;j++){
c[i+j]=a[i]*b[j]+x+c[i+j];
x=c[i+j]/10;
c[i+j]%=10;
}
c[i+lenb]=x;
}
int lenc=lena+lenb;
while(c[lenc-1]==0&&lenc>1){
lenc--;
}
for(i=lenc-1;i>-1;i--){
cout<<c[i];
}
return 0;
}
by 居然Tommy @ 2022-09-18 13:17:11
Thanks of 各位大佬