Bài 2:
#include <bits/stdc++.h>
using namespace std;
long long n,i,a[1000],x;
int main()
{
freopen("bai2.inp","r",stdin);
freopen("bai2.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]%2==0)
{
x=a[i];
break;
}
cout<<x<<endl;
for (i=1; i<=n; i++)
if (a[i]==x) cout<<i<<" ";
return 0;
}
Đúng 0
Bình luận (0)