Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void wypelnij(int &tab[], int n){
- for(int 0; i<n; i++){
- cout<<"podaj element ciągu";
- cin>>tab[i];
- }
- void wypisz(int &tab[], int n, int &licznik){
- licznik=0;
- for(int i=0; i<n; i++){
- if(tab[i]> 0){
- cout<<tab[i];
- }
- if(tab[i]<0){
- cout<<endl;
- licznik++;
- }
- }
- if(tab[n-1]>0){
- licznik++;
- }
- }
- int main{
- int tab[1000];
- int licznik;
- int n;
- wypelnij(tab,n);
- wypisz(tab,n,licznik);
- cout<<"liczba ciągow dodatnich"<< licznik;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement