发布时间:2019-09-16 07:20:18编辑:auto阅读(1562)
s1=input('please enter number:')
s2=input('please enter number:')
L1=[0]
L2=[0]
for i in range(0,len(s1)):
L1.append(int(s1[i]))
for i in range(0,len(s2)):
L2.append(int(s2[i]))
if(len(s1)>len(s2)):
for i in range(len(s1)-len(s2)):
L2.append(0)
elif(len(s1)<=len(s2)):
for i in range(len(s2)-len(s1)):
L1.append(0)
for i in range(len(L1)):
L1[i]=L1[i]+L2[i]
A=B=len(L1)-1
while A>0:
if((L1[A])/10)>=1: # or if((L1[A]//10)>0)
L1[A]=L1[A]%10
L1[A-1]=L1[A-1]+1
A-=1
if L1[0]==0:
for i in range(1,B+1):
print(L1[i],end='')
elif L1[0]!=0:
for i in range(B+1):
print(L1[i],end='')
上一篇: python 发送邮件给多人
下一篇: linux 查看python安装路径,版
47842
46390
37283
34733
29313
25973
24916
19951
19544
18030
5792°
6413°
5927°
5961°
7064°
5911°
5944°
6438°
6404°
7778°