Advertisement
tramix32

cppp

Dec 25th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a,n=0,suma=0;
  8. while (a>0)
  9. {
  10. cin >> a;
  11.     if (a<=0){
  12.         break;
  13.     }
  14. suma+=a;
  15. ++n;
  16. }
  17. cout << suma/n << endl;
  18. system("pause");
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement