Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int liczba, suma = 0, licznik = -1;
- do
- {
- cin >> liczba;
- suma += liczba;
- licznik++;
- }
- while(liczba != 0);
- cout << 1.0 * suma/licznik; // aby program wypisywał faktyczną wartość (a nie całkowitą), to musimy najpierw kazać pomnożyć jedną z liczb przez 1.0
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement