-
[python]백준 비교 연산자 5656번알고리즘 문제풀이/백준(파이썬) 2023. 6. 7. 23:53
코드
import sys sys.stdin = open("5656.txt", "r") s=0 while True: a,b,c=map(str, input().split()) if b=='E': break if b==">": s+=1 z=int(a)>int(c) print(f"Case {s}: {str(z).lower()}") if b==">=": s+=1 z=int(a)>=int(c) print(f"Case {s}: {str(z).lower()}") if b=="<": z=int(a)<int(c) s+=1 print(f"Case {s}: {str(z).lower()}") if b=="<=": z=int(a)<=int(c) s+=1 print(f"Case {s}: {str(z).lower()}") if b=="==": s+=1 z=int(a)==int(c) print(f"Case {s}: {str(z).lower()}") if b=="!=": s+=1 z=int(a)!=int(c) print(f"Case {s}: {str(z).lower()}")
링크
https://www.acmicpc.net/problem/5656
'알고리즘 문제풀이 > 백준(파이썬)' 카테고리의 다른 글
[python]백준 특별한 날 10768번 (0) 2023.06.09 [python]백준 치킨댄스를 추는 곰곰이를 본 임스 25191번 (0) 2023.06.08 [python]백준 스시 20494번 (0) 2023.06.06 [python]백준 민균이의 비밀번호 9933번 (0) 2023.06.05 [python]백준 자동완성 24883번 (0) 2023.06.04