diff options
Diffstat (limited to '282A/main.cpp')
| -rw-r--r-- | 282A/main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/282A/main.cpp b/282A/main.cpp new file mode 100644 index 0000000..b40012d --- /dev/null +++ b/282A/main.cpp @@ -0,0 +1,25 @@ +#include <iostream> +#include <string> + +using namespace std; + +int main(){ + string a; + getline(cin, a); + int b = stoi(a); + int c = 0; + for(int i = 0; i < b; i++){ + getline(cin, a, '\n'); + if(a.compare("X++") == 0){ + c++; + } else if (a.compare("++X") == 0){ + ++c; + } else if (a.compare("--X") == 0){ + --c; + } else { + c--; + } + } + cout<<c; + return 0; +} |
