importtimeimportmathmultiplier1,multiplier2=0,0count1,count2=0,0Multiply1,Multiply2=1,1i,i1=0,0he=0scount1=0scount2=0a=[0]*100000b=[0]*100000#前面都是在定义变量print("Please enter two multipliers")#提示输入数字multiplier1=int(input())#输入数字multiplier2==int(input())#输入数字time_start=time.time()#计算代码速度count1=scount1=int(math.log10(multiplier1)+1)#计算数字A的位数count2=scount2=int(math.log10(multiplier2)+1)#计算数字B的位数while(scount1>0):#分解位数下同a[scount1]=multiplier1%10#分解位数存入数组multiplier1//=10#数字变小scount1=scount1-1#下标变小while(scount2>0):b[scount2]=multiplier2%10multiplier2//=10scount2=scount2-1foriinrange(1,count1+1):#循环下标fori1inrange(1,count2+1):#循环下标sum=count1+count2-(i+i1)+1#计算10的次方数he=he+a[i]*b[i1]*pow(10,count1+count2-(i+i1))#累加a[n]*b[m]*10^iprint(a[i],b[i1],he,pow(10,count1+count2-(i+i1)),count1+count2,i1+i)#输出计算过程time_end=time.time()#计时结束print('totally cost',time_end-time_start)#输出代码时间print(he)#输入计算结果