본문 바로가기
python-algorithm

[백준] 5355

by 무적김두칠 2021. 1. 9.

1
2
3
4
5
6
7
8
9
import sys
for _ in range(int(sys.stdin.readline())):
    tmp=list(sys.stdin.readline().split())
    ans=float(tmp[0])
    for i in range(1,len(tmp)):
        if tmp[i]=='@': ans*=3
        elif tmp[i] == '%': ans += 5
        elif tmp[i] == '#': ans -= 7
    print("%.2f"%ans)
cs

 

반응형

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

[백준] 5524  (0) 2021.01.09
[백준] 5363  (0) 2021.01.09
[백준] 5218  (0) 2021.01.09
[백준] 5176  (0) 2021.01.09
[백준] 5026  (0) 2021.01.09

댓글