Răspuns:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,nr,sum_pare=0,medie_aritm=0,sum_impare=0,k=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>nr;
if(nr%2==0)
sum_pare=sum_pare+pow(nr,5);
else
{
sum_impare=sum_impare+nr;
k++;
}
}
medie_aritm=sum_impare/k;
cout<<"Suma numerelor pare la puterea a 5-a este: "<<sum_pare;
cout<<endl;
cout<<"Media aritmetica a numerelor impare este: "<<medie_aritm;
return 0;
}
Explicație: