更新第 2 次作业 1-7 题
This commit is contained in:
parent
9a677b84e9
commit
ba25d575d1
|
@ -0,0 +1,6 @@
|
||||||
|
print('''
|
||||||
|
精勤求学
|
||||||
|
敦笃励志
|
||||||
|
果毅力行
|
||||||
|
忠恕任事
|
||||||
|
''')
|
|
@ -0,0 +1,2 @@
|
||||||
|
a = float(input())
|
||||||
|
print(a*666.666666667)
|
|
@ -0,0 +1,8 @@
|
||||||
|
x1,y1 = map(float,input().split())
|
||||||
|
x2,y2 = map(float,input().split())
|
||||||
|
a = complex(round(x1+x2,1),round(y1+y2,1))
|
||||||
|
b = complex(round(x1-x2,1),round(y1-y2,1))
|
||||||
|
print(a)
|
||||||
|
print(b)
|
||||||
|
|
||||||
|
# 这个代码暂时有 bug,整数的时候不会补 0,但是暂时够用了
|
|
@ -0,0 +1,7 @@
|
||||||
|
a, b, c = map(float, input().split())
|
||||||
|
if (a+b <= c or b+c <= a or c+a < b):
|
||||||
|
print(-1)
|
||||||
|
else:
|
||||||
|
p = (a+b+c)/2
|
||||||
|
ans = (p*(p-a)*(p-b)*(p-c))**0.5
|
||||||
|
print("%.2f" % ans)
|
|
@ -0,0 +1,5 @@
|
||||||
|
a, b, c = map(int, input().split())
|
||||||
|
m = max(a, b, c)
|
||||||
|
n = min(a, b, c)
|
||||||
|
p = a+b+c-n-m
|
||||||
|
print(n, p, m)
|
|
@ -0,0 +1,22 @@
|
||||||
|
a = int(input())
|
||||||
|
ans = 0
|
||||||
|
while (a):
|
||||||
|
if (a >= 100):
|
||||||
|
a -= 100
|
||||||
|
ans += 1
|
||||||
|
elif (a >= 50):
|
||||||
|
a -= 50
|
||||||
|
ans += 1
|
||||||
|
elif (a >= 20):
|
||||||
|
a -= 20
|
||||||
|
ans += 1
|
||||||
|
elif (a >= 10):
|
||||||
|
a -= 10
|
||||||
|
ans += 1
|
||||||
|
elif (a >= 5):
|
||||||
|
a -= 5
|
||||||
|
ans += 1
|
||||||
|
else:
|
||||||
|
a -= 1
|
||||||
|
ans += 1
|
||||||
|
print(ans)
|
|
@ -0,0 +1,10 @@
|
||||||
|
m,kg = map(float,input().split())
|
||||||
|
b = kg/m**2
|
||||||
|
if(b<18.5):
|
||||||
|
print("A")
|
||||||
|
elif(b<24):
|
||||||
|
print("B")
|
||||||
|
elif(b<28):
|
||||||
|
print("C")
|
||||||
|
else :
|
||||||
|
print("D")
|
Loading…
Reference in New Issue