fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i,n,x=0;
  6. string str;
  7. cin>>n;
  8. for(i=0;i<n;i++)
  9. {cin>> str;
  10. for(i=0;i<n;i++)
  11. {if(str[i]=='+')
  12. {x=x+1;
  13. break;}
  14. }
  15. }
  16. cout<< x;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 15232KB
stdin
2
x++
++x
stdout
1