Commit a6c1ec2c by BellCodeEditor

save project

parent 45396374
Showing with 37 additions and 23 deletions
a=int(input("输入一个正整数"))
s=0
if a%2==0:
for i in range(2,a+1,2):
s=s+1/i
if a%2==1:
for i in range(1,a+1,2):
s=s+1/i
print("%.2f"%s)
for ab in range(10,100):
x=100+ab
y=ab*10+1
if x-y==468 or y-x==468:
print(ab)
\ No newline at end of file
for gj in range(1,99):
for mj in range(1,99):
xj=100-gj-mj
if 5*gj+3*mj+xj/3==100:
print(gj,mj,xj)
\ No newline at end of file
student1 = {'语文': 91, '数学': 88, '英语': 85}
student2 = {'语文': 97, '数学': 98, '英语': 90}
student3 = {'语文': 95, '数学': 100, '英语': 93}
score = {'悟空': student1, '诺依': student2, '小贝': student3}
class Price():
def pay(self):
a=int(input("星期几"))
b=int(input("成人人数"))
c=int(input("小孩人数"))
if a<6:
print("需要支付"+str(b*100+c*50)+"元")
else:
print("需要支付"+str(b*120+c*60)+"元")
b=Price()
b.pay()
# 查询并打印出输入的名字对应的所有科目的成绩
while True :
name = input("名字:")
if name=="q":
break
elif name in score :
a = score[name]
print('='*30)
for k,v in a.items():
print(k,v)
print("="*30)
else:
print('输入错误')
\ No newline at end of file
for ji in range(1,35):
tu=35-ji
if tu+ji==35 and 4*tu+2*ji==94:
print("兔有{}只,鸡有{}只".format(tu,ji))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment