Va rog am puteti ajuta............

Răspuns 1 C++:
#include <iostream>
using namespace std;
int main()
{
int n, nr, i, x;
cin >> n;
for(i = 1; i <= n; i++){
cin >> nr;
if(nr % 2 == 0)
x = nr;
}
cout << x;
return 0;
}
Răspuns 2 C++:
#include <iostream>
using namespace std;
int main()
{
int n, nr, i, x, OK = 0;
cin >> n;
for(i = 1; i <= n; i++){
cin >> nr;
if(OK == 0 && nr % 2 == 1){
x = nr;
OK = 1;
}
}
cout << x;
return 0;
}