fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5. typedef vector<int> vi;
  6. typedef pair<int,int> pi;
  7. #define F first
  8. #define S second
  9. #define PB push_back
  10. #define MP make_pair
  11. #define REP(i,a,b) for (int i = a; i <= b; i++)
  12.  
  13. int main() {
  14. ios_base::sync_with_stdio(0);
  15. cin.tie(0);
  16. //freopen("input.txt", "r", stdin);
  17. //freopen("output.txt", "w", stdout);
  18. int p, n;
  19. double tp=0;
  20. cin >> n;
  21. REP(i, 1, n) {
  22. cin >> p;
  23. tp += p;
  24. }
  25. printf("%.12lf", ((tp / 100) / n)*100);
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 15240KB
stdin
3
50 50 100
stdout
66.666666666667