1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| #include <bits/stdc++.h> using namespace std;
int main() { int a[4] = {3, 22, 3, 24}; int max, min = a[0];
for (int i = 0; i < 4; i++) { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } }
cout << max << endl << min; return 0; }
|