본문 바로가기
python-algorithm

백준 31654 Adding Trouble

by 무적김두칠 2024. 4. 15.

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

 

31654번: Adding Trouble

Your friend Bob is really bad at adding numbers, and he’d like some help to make sure he’s doing it correctly! Can you help Bob make sure he is adding correctly? Given 3 integers $A$, $B$, $C$, make sure that $A + B = C$, and that Bob indeed added $A$

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
def sol(a, b, c):
    if a + b == c:
        return "correct!"
    else:
        return "wrong!"
 
 
if __name__ == '__main__':
    a, b, c = map(int, input().split())
    print(sol(a, b, c))
 
cs
반응형

댓글