AP3_(1).cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using namespace std;
 
int big(int x, int y) {
    if (y > x) {
        if (y < 100return y;
    }
    else {
        if (x < 100return x;
    }
    return 100;
}
 
int big(int x, int y, int limit) {
    if (y > x) {
        if (y < limit) return y;
    }
    else {
        if (x < limit) return x;
    }
    return limit;
}
 
int main() {
    int x = big(35);
    int y = big(30060);
    int z = big(306050);
    cout << x << ' ' << y << ' ' << z << endl;
}
cs

AP3_(2).cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
using namespace std;
 
int big(int x, int y, int limit = 100) {
    if (y > x) {
        if (y < limit) return y;
    }
    else {
        if (x < limit) return x;
    }
    return limit;
}
 
int main() {
    int x = big(35);
    int y = big(30060);
    int z = big(306050);
    cout << x << ' ' << y << ' ' << z << endl;
}
cs


+ Recent posts