fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int sum = 0;
  6. string input;
  7. for(int i = 0; i < 4; ++i){
  8. cin >> input;
  9. if(input == "++")
  10. sum++;
  11. else
  12. sum--;
  13. }
  14. cout << sum << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5292KB
stdin
-- -- -- -- 
stdout
-4