1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;
 
bool bigger(int a, int b, int &big) {
    if (a == b) return true;
    else {
        b > a ? big = b : big = a;
        return false;
    }
}
 
int main(){
    int a, b, max;
    cout << "두 개의 정수를 입력하시오>> ";
    cin >> a >> b;
    if (bigger(a, b, max)) cout << "두 정수가 같습니다." << endl;
    else cout << "두 정수중 더 큰 것은 " << max << "입니다." << endl;
};
cs


+ Recent posts