본문 바로가기
category/백준 알고리즘 c++

백준 알고리즘 1330번 두 수 비교하기 c++

by 자운대고라니 2020. 12. 3.
반응형

요약 : 두 수의 값을 비교하여 >, <, == 를 결정한다.


소스코드

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
 
using namespace std;
 
int main(void) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int a,b;
    cin >> a >> b;
    if(a>b) cout << ">" << endl;
    else if(a<b) cout << "<" << endl;
    else cout << "==" << endl;
    return 0;
}
cs

정답 확인

반응형

댓글