Răspuns:
#include<iostream>
using namespace std;
int main()
{
int n,i,x,v[100],s=0,k=0 ;
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
{
cin>>v[i];
}
for(i=1;i<=n;i++)
{
if(v[i]%3==0)
{
s=s+v[i];
k++;
}
}
cout<<"Media aritmetica= "<<s/k<<endl;
for(i=1;i<=n;i++)
{
x=v[i];
if(x>9 && x<100)
{
x=x*10 + (x/10%10);
cout<<x<<" ";
}
}
return 0;
}
Explicație: