输入三个数a,b,c, 判断能否以它们为三个边长构成直角三角形。若能,输出YES,否则输出NO。
a=eval(input())
b=eval(input())
c=eval(input())
d=max(a,b,c)
e=min(a,b,c)
f=sum([a,b,c])-e-d
if e<=0 or e+f<=d:
print('NO')
elif e**2+f**2==d**2:
print('YES')
else:
print('NO')
闰年366天,其他年份365天。普通年(不能被100整除的年份)能被4整除的为闰年。(如2004年就是闰年,1999年不是闰年); 世纪年(能被100整除的年份)能被400整除的是闰年。(如2000年是闰年,1900年不是闰年); 用户输入一个正整数,代表年份,输出该年有多少天?
num = int(input())
if num % 100 == 0:
if num % 400 == 0:
print(366)
else:
print(365)
else:
if num % 4 == 0:
print(366)
else:
print(365)
输入三个数a,b,c, 判断能否以它们为三个边长构成三角形。若能,输出YES和三角形面积(结果保留2位小数),否则输出NO
from math import sqrt
a=float(input())
b=float(input())
c=float(input())
p=(a+b+c)/2
if a>0 and b>0 and c>0:
if a+b>c and a+c>b and b+c>a:
s=sqrt(p*(p-a)*(p-b)*(p-c))
print('YES')
print(f'{s:.2f}')
else:
print('NO')
else:
print('NO')
测算身高,单位为厘米,公式参考下列: 男性身高=(父亲身高+母亲身高)×1.08÷2 女性身高=(父亲身高×0.923+母亲身高)÷2
性别输入"男"或“女”,本题保证所有测试输入身高数据为整型,输出结果取整。如果性别输入不符合要求,则输出“无对应公式
n=int(input())
m=int(input())
x=input()
if x=='男':
num=(m+n)*1.08/2
print(int(num))
if x=='女':
num=(n*0.923+m)/2
print(int(num))
if x!='男' and x!='女':
print('无对应公式')
目前我国个人所得税计算公式如下: