第一题
h1,m1,h2,m2=map(int,input().split()) if m2<m1: m2+=60 h2-=1 print('{0}:{1}'.format(h2-h1,m2-m1))
第二题
import math a,b,c=map(int,input().split(',')) if b**2-4*a*c<0: print("无实根!") else: x1 = (-b + math.sqrt(b ** 2 - 4 * a * c)) / (2 * a) x2 = (-b - math.sqrt(b ** 2 - 4 * a * c)) / (2 * a) print(f'x1={x1:.2f},x2={x2:.2f}')
第三题
x=int(input()) y=int(input()) z=int(input()) if (x+y+z)/3>=90 and x>=85 and y>=85 and z>=85: print("符合学习优秀学生条件") else: print("不符合条件")
第四题(暂时错误)
x=int(input()) if x<=210: cost=x*0.5469 elif x<=400: cost=210*0.5469+(x-210)*0.5969 else: cost=210*0.5469+190*0.5969+(x-400)*0.8469 print(f'cost = {cost:.2f}')
第五题(感谢葛某人的贡献)
r,h=input().split() r=float(r) h=float(h) L=(3.14159*r*r*h)/1000 if(15%L==0): result=15//L else: result=(15//L)+1 print("%d"%(result))
第六题
x=int(input()) y=int(input()) print(x+y) print((x+y)/2)
第七题
mon,jzx=map(int,input().split()) if mon>=7 and mon<=9: if jzx>=20: print('10') else: print('5') else: if jzx>=20: print('20') else: print('10')
第八题
cnt=[0]*10 num_list=input().split() for num in num_list: cnt[int(num)]+=1 for i in range(10): print(cnt[i],end=' ')
第九题
x,y=map(int,input().split()) for i in range(y+1): print('pow({0},{1}) = {2}'.format(x,i,x**i))
第十题
s = input() idx = 0 while idx < len(s) and s[idx].isdigit(): idx += 1 if idx < len(s) and s[idx] in "+-*": a = int(s[:idx]) op = s[idx] b = int(s[idx+1:]) if op == "+": print(a + b) elif op == "-": print(a - b) elif op == "*": print(a * b) else: print("error")
第十一题
x=input() s=0 for i in x: s+=int(i) print(s)
停留在世界边缘,与之惜别