rengetsu

Proced_3_Pratyb_3.05

Mar 13th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6. double n,a[11],sum=0,z=0;
  7. cin>>n;
  8. for(int i=0;i<n;i++)
  9. {cin>>a[i];if(a[i]>0){sum+=a[i];z+=1;}}
  10. if(z==0){cout<<"NO"<<endl;}else{cout<<fixed<<setprecision(2)<<sum/z<<endl;}
  11. return 0;
  12. }
Add Comment
Please, Sign In to add comment