-Code
for _ in range(int(input())):
s = input().split()
a, b, c = int(s[0]), int(s[2]), int(s[4])
x = s[1]
if x == '+':
res = a + b
elif x == '-':
res = a - b
elif x == '*':
res = a * b
elif x == '/':
res = a // b
print("correct" if res == c else "wrong answer")
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 10205번 헤라클레스와 히드라 (0) | 2022.07.06 |
---|---|
[백준/파이썬] 14561번 회문 (0) | 2022.07.05 |
[백준/파이썬] 7482번 상자 만들기 (0) | 2022.07.03 |
[백준/파이썬] 8949번 대충 더해 (0) | 2022.07.02 |
[백준/파이썬] 7489번 Shares (0) | 2022.07.01 |