본문 바로가기
알고리즘/백준

백준-5355번(화성 수학)-python3

by nyeongha 2023. 11. 26.
for x in range(int(input())):
    i=list(input().split())
    z=0
    for y in i:
        if y=='@':
            z*=3
        elif y=='%':
            z+=5
        elif y=='#':
            z-=7
        else:
            z+=float(y)
    print('%.2f'%z)