编码记录
#1i=1
time=input('请输入整数:')
time1=int(time)
while time1>=i:
print('%d' %(i))
i=i+1
#2
k=input('请输入整数:')
i=int(k)
j=i-1
while i:
print(' '*j+'*'*i)
i=i-1
j=j-1
#3
year=input('请输入年份:')
year1=int(year)
if year1%100==0:
if year1%400==0:
print('这是闰年')
else:
print('这不是闰年')
else:
if year1%4==0:
print('这是闰年')
else:
print('这不是闰年') #4
i=0
while i<=100:
if i%2!=0:
print(i)
i+=1 #5
m=input('请输入阶梯最大值,查找该阶梯以内满足条件的阶梯数:')
while (not(m.isdigit())):
print('输入不合法!请重新输入:',end=' ')
m=input()
m=int(m)
x = 7
i = 1
flag = 0
while x <= m:
if (x%2 == 1) and (x%3 == 2) and (x%5 == 4) and (x%6==5):
flag = 1
print('阶梯数有:',x)
x = 7 * (i+1)
else:
x = 7 * (i+1) # 根据题意, x 一定是 7 的整数倍,所以每次乘以 7
i += 1
if flag == 1:
print(end=' ')
else:
print('在',m,'阶内找不到答案!') 6#
s=input('输入成绩:')
s=int(s)
if 100>=s>=90:
print('A')
elif 90>s>=80:
print('B')
elif 80>s>=60:
print('C')
elif 60>s>=0:
print('D')
else:
print('输入错误!') small=x if (x<y and x<z) else (y if y<z else z)
页:
[1]