python-algorithm

백준 26531 Simple Sum

무적김두칠 2022. 12. 22. 16:38

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

 

26531번: Simple Sum

You have hired someone to help you with inventory on the farm. Unfortunately, the new cowhand has very limited math skills, and they are having trouble summing two numbers. Write a program to determine if the cowhand is adding these numbers correctly.

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
def sol(s):
    left,right = s.split('=')
    if eval(left) == int(right):
        return 'YES'
    else:
        return 'NO'
 
if __name__ == '__main__':
    s = input()
    print(sol(s))
 
cs
반응형