Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n, a, cnt=0, M;
  8. double m=0;
  9. cin >> n;
  10. for(int i=1; i<= n; i++)
  11. {
  12. cin >> a;
  13. if(a%2 == 0)
  14. {
  15. m+=a;
  16. cnt ++;
  17. }
  18.  
  19. }
  20. m /= cnt;
  21. M = m*100;
  22. cout << M/100 << '.' << M%100;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement