Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- int main()
- {
- std::cout<<"Podawaj kolejne liczby lub wpisz 0 aby zakonczyc: ";
- double wynik=0, ilosc=0, liczba;
- do
- {
- std::cin>>liczba;
- wynik += liczba;
- ilosc++;
- }
- while(liczba != 0);
- wynik/=(ilosc-1);
- std::cout<<"\nPodales "<<ilosc-1<<" liczb. Ich srednia to: "<<wynik<<".\n";
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement