Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,suma=0, liczba,i=0;
- cout<<"Ile podasz liczb?";
- cin>>n;
- while(i<n){
- cout<<"Podaj liczbę: ";
- cin>>liczba;
- suma=suma+liczba;
- i++;
- }
- cout<<"Średnie podanych" << n <<" liczb rowna sie: "<< static_cast<float>(suma)/static_cast<float>(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement