Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int numeros = 0;
- int media = 0;
- int n;
- while (cin >> n and n != -1) {
- if (n >= 1 and n <= 100) {
- ++numeros;
- media += n;
- }
- }
- cout << "cantidad de numeros entre 1 y 100: " << numeros << endl;
- cout << "media: " << media/numeros << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement