BOJ | 1330번

송치헌·2021년 5월 27일
0
post-thumbnail

Python 풀이

A, B = map(int,input().split())

if A > B: # A가 B보다 크다면
    print('>') # '>' 출력
elif A < B: # 그렇지 않고 A가 B보다 작다면
    print('<') # '<' 출력
else: # 둘다 아니라면
    print('==') # '==' 출력

조건문 if를 이용하여 대수비교를 하는 문제이다. 어려운 문제는 아니니 설명은 스킵

C++ 풀이

#include <iostream>

using namespace std;

int main()
{
	int A, B;
	cin >> A >> B;
	if (A > B) cout << ">";
	else if (A < B) cout << "<";
	else cout << "==";
}
profile
https://oraange.tistory.com/ 여기에도 많이 놀러와 주세요

0개의 댓글