Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {int arr[5], cons=0, pros=0;
- for(int i=0; i<5; i++){
- cin>>arr[i];
- if(arr[i]<0){
- cons++;}
- else if(arr[i]>0){
- pros++;}
- }
- {for(int b=0; b<5; b++)
- if(cons>pros && arr[b]<0)
- cout<<arr[b]<<" ";}
- {for(int c=0; c<5; c++)
- if(cons<pros && arr[c]>0)
- cout<<arr[c]<<" ";}
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement