Răspuns :
#include <iostream>
using namespace std;
int main()
{
int n, num, i, ultim_par;
cin >> n;
for (i=1; i<=n; ++i)
{
cin >> num;
if (num%2==0) { ultim_par=num; }
}
cout << ultim_par;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n, nr, i, par=-1;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>nr;
if(nr%2==0)
par=nr;
}
if(par==-1)
cout<<"IMPOSIBIL";
else cout<<par;
return 0;
}