ZadatakN29

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int i,n, br=0;
float s,niz[100];
s=0;
i=0;
do
{
cin>>niz[i];

if(niz[i]!=-1)
s=s+niz[i];
if(niz[i]!=-1)
br++;
}
while(niz[i]!=-1);
i++;
cout<<fixed<<setprecision(2)<< s/br;
return 0;
}

Advertisements