Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int f(int n, int a[100])
- {
- int p=0, n=0;
- for(int i=0; i<n; i++)
- {
- if(a[i]>0)
- p++;
- if(a[i]<0)
- n++;
- }
- if(n>p)
- return -1;
- if(n==p)
- return 0;
- if(p>n)
- return 1;
- }
- int main()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement