Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int a,n=0,suma=0;
- while (a>0)
- {
- cin >> a;
- if (a<=0){
- break;
- }
- suma+=a;
- ++n;
- }
- cout << suma/n << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement