Răspuns:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{unsigned int n,i,nr;
float x,s,prod,sarmo;
cin>>n;
s=nr=sarmo=0;
prod=1;
for (i=1;i<=n;i++)
{cin>>x;
s=s+x;
nr=nr+1;
prod=prod*x;
sarmo=sarmo+(1/x);}
cout<<"Media aritmetica este:"<<s/nr<<endl;
cout<<"Media geometrica este:"<<sqrt(prod)<<endl;
cout<<"Media armonica este:"<<n/sarmo;
return 0;
}
sarmo - suma armonica (de la numitor)