Advertisement
Josif_tepe

Untitled

Mar 6th, 2023
935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n; cin>>n;
  8.     double average=0;
  9.     double broj_na_clenovi=0;
  10.     for(int i=0; i<n; i++){
  11.         int a;
  12.         cin>>a;
  13.         if(a>=90){
  14.         average+=a;
  15.         broj_na_clenovi++;
  16.         }
  17.     }
  18.  
  19.     double k=average/broj_na_clenovi;
  20.     k += 0.001;
  21.     printf("%.2f\n", k);
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement