본문 바로가기
python-algorithm

백준 26530 Shipping

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

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

 

26530번: Shipping

The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will start with a single integer x denoting how many items follow. The next x lines consist of a string, and integer, and a floating point numb

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x = int(input())
        total_price = 0
        for __ in range(x):
            name, unit, price = input().split()
            total_price += int(unit)*float(price)
        print('$%.2f'%(total_price))
 
cs
반응형

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

백준 26767 Hurra!  (0) 2022.12.26
백준 26768 H4x0r  (0) 2022.12.26
백준 26566 Pizza  (0) 2022.12.24
백준 26731 Zagubiona litera  (0) 2022.12.24
백준 26532 Acres  (0) 2022.12.24

댓글