In [4]:
print('please enter an int ')
m=int(input())
print('please enter an int,and the int !=0')
n=int(input())
print('please enter 1 means 乘法 2 means 加法 or 3 means取余 or others means m整除n')
a=int(input())
if a==1:
if m>=n:
c=1
b=n
while b<=m:
c=c*b
b=b+1
print('1',c)
else:
c=1
b=m
while b<=n:
c=c*b
b=b+1
print('1',c)
elif a==2:
if m>=n:
i=m-n
else:
i=n-m
x=(m+n)*(i+1)/2
print('2',x)
elif a==3:
k=m%n
print('3',k)
else:
z=int(m/n)
print('others',z)
In [ ]:
In [ ]: