Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int wyswietl(float liczba){
- cout<<liczba;
- }
- int podaj_ilosc(){
- int ilosc;
- cout<<"Podaj ilosc ";
- cin>>ilosc;
- return ilosc;
- }
- int main()
- {
- int N,liczba=0,suma=0;
- float srednia;
- N=podaj_ilosc();
- int tab[N];
- for (int i=0;i<N;i++){
- cout<<"Podaj liczbe ";
- cin>>liczba;
- suma+=liczba;
- tab[i] = liczba;
- }
- srednia=(float)suma/(float)N;
- for (int j=0;j<N;j++){
- cout<<tab[j]<<" ";
- }
- cout<<srednia;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement