본문 바로가기
python-algorithm

백준 26592 Triangle Height

by 무적김두칠 2022. 12. 23.

https://www.acmicpc.net/problem/26592

 

26592번: Triangle Height

The first line will contain a single integer n that indicates the number of lines that follow. Each line will include the area and base length of a triangle with the two values separated by a single space. area base

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
def sol(a, b):
    answer = 2*a/b
    return answer
 
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        a, b = map(float, input().split())
        print('The height of the triangle is %.2f units'%sol(a, b))
 
cs
반응형

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

백준 26546 Reverse  (0) 2022.12.23
백준 10188 Quadrilateral  (0) 2022.12.23
백준 26561 Population  (0) 2022.12.23
백준 26736 Wynik meczu  (0) 2022.12.23
백준 5358 Football Team  (0) 2022.12.22

댓글