fork download
  1. #include <iostream>
  2. using namespace std;
  3. int V[10];
  4. int T[10]= {1,2,3,4,5,6,7,8,9,10};
  5. int Q[]={11,12,13};
  6. int main() {
  7. for (int i=0;i<10;i++)
  8. cin>>V[i];
  9. for (int i=0;i<10;i++)
  10. cout<<V[i]<<"\t";
  11. cout<<endl;
  12. for (int i=0;i<10;i++)
  13. cout<<T[i]<<"\t";
  14. cout<<endl;
  15. for (int i=0;i<3;i++)
  16. cout<<Q[i]<<"\t";
  17. // media aritmetica semplice degli elementi del vettore V
  18. cout<<endl;
  19. int somma=0;
  20. for (int i=0;i<10;i++)
  21. somma = somma + V[i];
  22. float Media= somma/10.0;
  23. cout<<"Media= "<<Media<<endl;
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5276KB
stdin
1 2 3 4 5 6 7 8 9 10
stdout
1	2	3	4	5	6	7	8	9	10	
1	2	3	4	5	6	7	8	9	10	
11	12	13	
Media= 5.5