fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. int max,n;
  8. int x;
  9. cin>>n;
  10. int countplus;
  11. countplus=0;
  12.  
  13. for(int i=0;i<n;i++){
  14. cin>>x;
  15. if (x>0){
  16. countplus=countplus+1;//countplus++;++countplus
  17. }
  18.  
  19. }
  20. cout<<countplus<< " "<<n-countplus;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5288KB
stdin
5
-16
-178
157
183
-144
1000
stdout
2 3