본문 바로가기
python-algorithm

백준 10698 Ahmed Aly

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

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

 

10698번: Ahmed Aly

Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 100). Followed by T lines, each test case is a single line containing an equation in the following format

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def sol(s):
    left, right = s.split('=')
    if eval(left)==int(right):
        return 'YES'
    else:
        return 'NO'
 
 
if __name__ == '__main__':
    n = int(input())
    for i in range(1,n+1):
        s = input()
        s = s.replace(' ','')
        print('Case %d: %s'%(i, sol(s)))
cs
반응형

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

백준 26264 빅데이터? 정보보호!  (0) 2022.12.30
백준 26004 HI-ARC  (0) 2022.12.28
백준 16428 A/B - 3  (0) 2022.12.28
백준 4806 줄 세기  (0) 2022.12.26
백준 17094 Serious Problem  (0) 2022.12.26

댓글