본문 바로가기
python-algorithm

[백준] 6322

by 무적김두칠 2020. 12. 24.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sys
import math
cnt=1
while True:
    a,b,c=map(int,sys.stdin.readline().split())
    if a==and b==and a==0: break
    elif (a>=or b>=c) and c!=-1 : print("Triangle #%d"%cnt); print("Impossible.")
    elif a==-1print("Triangle #%d"%cnt); print("a = %.3f"% (math.sqrt(pow(c,2)-pow(b,2))))
    elif b == -1:
        print("Triangle #%d" % cnt); print("b = %.3f" % (math.sqrt(pow(c, 2- pow(a, 2))))
    elif c == -1:
        print("Triangle #%d" % cnt); print("c = %.3f" % (math.sqrt(pow(a, 2+ pow(b, 2))))
    cnt+=1
    print()
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 7510  (0) 2020.12.24
[백준] 6378  (0) 2020.12.24
[백준] 6131  (0) 2020.12.24
[백준] 5717  (0) 2020.12.24
[백준] 5612  (0) 2020.12.23

댓글