Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int mn = INT_MAX, mx = INT_MIN;
- for (int i = 0; i < n; i++){
- int a;
- cin >> a;
- if (a > 0 && a % 2 == 0)
- mn = min(mn, a), mx = max(mx, a);
- }
- if (mx == INT_MIN)
- cout << "Not found\n";
- else
- cout << mx << " " << mn << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment