문제
풀이
if-else if-else문으로 두 수의 크기를 비교한다.
코드
#include <iostream>
using namespace std;
int main() {
int a,b;
scanf("%d %d", &a, &b);
if (a>b){
cout << '>' << endl;
}
else if (a<b) {
cout << '<' << endl;
}
else {
cout << "==" << endl;
}
return 0;
}
'BOJ > C++' 카테고리의 다른 글
[BOJ/백준] 10171 - 고양이 (C++) (1) | 2024.12.27 |
---|---|
[BOJ/백준] 10699 - 오늘 날짜 (C++) (0) | 2024.12.26 |
[BOJ/백준] 1001 - A-B (C++) (0) | 2024.09.19 |
[BOJ/백준] 1000 - A+B (C++) (2) | 2024.09.19 |
[BOJ/백준] 2557 - Hello World (C++) (0) | 2024.09.19 |