Advertisement
Dizzy3113

Untitled

Nov 17th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int f(int n, int a[100])
  6. {
  7. int p=0, n=0;
  8. for(int i=0; i<n; i++)
  9. {
  10. if(a[i]>0)
  11. p++;
  12. if(a[i]<0)
  13. n++;
  14. }
  15. if(n>p)
  16. return -1;
  17. if(n==p)
  18. return 0;
  19. if(p>n)
  20. return 1;
  21. }
  22. int main()
  23. {
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement