fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int A[10]={3,6,34,25,18,44,108,10,1,66};
  5. int Somma=0;
  6. int main() {
  7. for(int i=0;i<10;i++)
  8. Somma=Somma + A[i];
  9.  
  10. cout<<"Somma="<<Somma<<endl;
  11.  
  12. float Media=(float) Somma/10.0;
  13.  
  14. cout<<"Media="<<Media<<endl;
  15.  
  16. int min= A[0];
  17. for(int i=1;i<10;i++)
  18. if(A[i]<min) {min=A[i];}
  19.  
  20. cout<<"Minimo="<<min<<endl;
  21.  
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
Somma=315
Media=31.5
Minimo=1