```## 1.输入圆半径,求面积与周长
r = int(input("R="))
s = 3.14*(r**2)
c = 2*3.14*r
print("S=",s,"\t","C=",c)
## 2.随机输入两个数,比较大小后,从小到大打印
a = int(input("number="))
b = int(input("number="))
if a = n:
break
## 11.斐波那契数列的第N项
a,b,c = 0,1,0
n = int(input(‘查询项:‘))
while 1:
a,b,c = b,a+b,c+1
if c == n:
print(a)
break
## 12.输入100位以内数据按位位打印
a = int(input())
x = 100#最大权
w = 10**x
log = 1
while log:
if a//w == 0:#找最高位
x = x-1
w = 10**x
else:#找到最高位
log = 0
while w:
b = a//w#首位
a %= w#为下次循环变量改为余数
w //= 10#降权
print(b,end=‘ ‘)
## 13.给出随机0100中的数字,使其排序算法,如出现具体数字则排序结束`
import random
li = [1]
k = 0
while k != 88:
k = random.choice(range(100))
if k in li:
continue
li.append(k)
li.sort()
print(li)
## 14.求x以内的素数,给一个随机数,如果该数能整除质数,那该数就为合数
li = [2]
x = int(input())
for i in range(2,x):
a = 1
for n in li:
if i%n == 0:
a = 0
break
if a:
li.append(i)
print(li)
## 15.求1-2+3-4+5.......99的值
x,y = 0,1
for i in range(1,100):
i = i*y
x += i
y *= (-1)
print(‘count:‘,x)
## 16.用户登录,连续错误三次退出
name=input(‘user name:‘)
c = 3
while c:
key=input(‘pass word:‘)
if name == ‘1‘ and key == ‘2‘:
print(‘True‘)
break
else:
print( ‘False‘)
c = c-1
## 17.输入随机数字列出所有能整除它的数字
x = int(input())
li = []
for i in range(1,x+1):
if x%i == 0:
li.append(i)
print(li)
## 18.3文钱能买一只公鸡,2文钱能买一母鸡,1文钱能买3小鸡,现在花100钱买100鸡,如何买
for x in range(1,101):
c = 100-x
v = 100-x/3
for m in range(1,100):
if c-m == (v-2*m)/3 and c-m >= 0:
g = c-m
print(‘公鸡:‘,g,‘母鸡:‘,m, ‘小鸡:‘,x)
## 19.输入三个数,看是否能构成三角形
a = 5
b = 75
c = 6
if a+b l1[n]:
n = n + 1
print(‘质因数:‘,l2)
## 22.球从100米高处下落,每次反弹上次距离的一半,10次后,球运动多少米
b = 200
x = 100
for i in range(1,10):
b = b/2
x = x+b
print(x)
## 23.1,2,3,4个数字,能组成多少个不重复的数,每个数字只能用一次
l1 = [1,2,3,4]
l2 = []
a,b,c,d = 0,0,0,0
for a in l1:
for b in l1:
if a == b:
pass
else:#第一位数不等于第二位数
for c in l1:
if a == c or b == c:
pass
else:#第一位数不等于第三位数
for d in l1:
if a == d or b == d or c == d:
pass
else:#第一位数不等于第四位数
l2.append([a,b,c,d])
print(l2)
## 24.一个数+100后是一个完全平方数,再在加168又是一个,求该数
for i in range(1000000):
if 250000>i>10000:
t = 100
k = 500
elif 490000>i>250000:
t = 500
k = 700
elif 810000>i>490000:
t = 700
k = 900
elif 1000000>i>810000:
t = 900
k = 1000
else:
t = 0
k = 100
for u in range(t,k):
if i+100 == u*u:
for y in range(t,k):
if i+268 == y*y:
print(i,u,y)
## 25.猴子吃桃,x个桃子,每天早上吃掉一半+1,第10天早上发现剩1,求x
a = 1
for i in range(1,10):
a = 2*(a+1)
print(a)
## 26.已知a,b,c,与x,y,z--------------c==y,a!=x,
c=‘y‘
l1=[‘x‘,‘y‘,‘z‘]
for i in l1:
if i == c:
for a in l1:
if a != ‘x‘ and a != c:
for b in l1:
if b != c and b != a:
print(‘c:‘,c,‘ b:‘,b,‘ a:‘,a)
## 27.,打出该序列2/1,3/2,5/3,8/5,13/8,12/13......前20项之和
a = 2
b = 1
c = 0
for i in range(1,21):
c += a/b
a, b = a+b, a
print(c)
## 28.求1+2n+3n+4n+5n...20n
n,k = 2,0
for i in range(2,21):
k += i*n
#print(i,end=‘ ‘)
k+1
## 29.输入5位数看是否为回文数
a = input()
b = a[ :1]
c = a[1:2]
d = a[2:3]
e = a[3:4]
f = a[4:5]
if b == f and c == e:
print(‘yes‘)
else:
`print(‘no‘)```