公鸡5元一只母鸡3元一只小鸡1元3只,100元想买100只鸡有多少种买法
for a in range(0,21):
for b in range(0,34):
for c in range(0,101):
if a + b + c100 and a5+b3+c/3100:
print(a,b,c)
韩信点兵
for i in range(1000,1101):
if i%32 and i%54 and i%7==6:
print(i)
九九乘法表
for i in range(1,10):
for j in range (1,i+1):
print("{}{}={:2d}".format(i,j,ij),end=" ")
print()
输入一个正整数求该数的阶乘
x=eval(input(“请输入一个正整数”))
t=1
for i in range(1,x+1):
t=t*i
print(t)
100以内含100奇数与偶数的和
s1,s2=0,0
for i in range(1,101):
if i%2==1:
s1=s1+i
else:
s2=s2+i
print(s1,s2)
计算前30项的和: s=1+(1+2)+(1+2+3)+(1+2+3+4)+…+(1+2+3+4+…+n)
s,y=0,0
for i in range(1,31):
s=s+i
y=y+s
print(y)