python头歌实践教学平台-python第三章作业(初级)
第1关 判断是否直角三角形
(图片来源网络,侵删)
a=eval(input()) b=eval(input()) c=eval(input()) shortest=min(a,b,c) longest=max(a,b,c) middle=sum([a,b,c])-shortest-longest if shortestb and b+c>a: s=(a+b+c)/2 area=(s*(s-a)*(s-b)*(s-c))**0.50 print('YES') print(f'{area:.2f}') else: print('NO')
第4关 身高测算
father_h=int(input()) mother_h=int(input()) child=input() if child=="男": child_h=(father_h+mother_h)*1.08/2 print(int(child_h)) elif child=="女": child_h=((father_h*0.923)+mother_h)/2 print(int(child_h)) else: print(f'无对应公式')
第5关 个税计算器
n=eval(input()) x=0 if n
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。
还没有评论,来说两句吧...