Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
372 B
2
Indexable
Never
#include <iostream>
#include <cmath> 
using namespace std; 
int main()
{
    int n;
    cin >> n;
    
    int maxCh = -100001;//
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        if (t % 2 == 0 && t > maxCh) {
             maxCh = t;
        }
    }
    if (maxCh == -100001) cout << "NO";
    else cout << maxCh;
}