fork download
  1. #include <iostream>
  2. using namespace std;
  3. int n;
  4. int numero;
  5. int somma;
  6.  
  7. int main() {
  8. cin>>n;
  9. for (int i=0; i<n; i++) { cin>>numero; somma = somma + numero;}
  10. double media = somma / n;
  11.  
  12. cout<<media<<endl;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 5280KB
stdin
10
6 28 3 42 5 27 3 86 1 36
stdout
23