diff --git a/solutions/clang/282A.c b/solutions/clang/282A.c new file mode 100644 index 0000000..e12111e --- /dev/null +++ b/solutions/clang/282A.c @@ -0,0 +1,26 @@ +#include +#include + +int main() { + int n,i; + scanf("%d", &n); + + getchar(); + + int count = 0; + + for (i = 0; i < n; i++) { + char operation[4]; + scanf("%s", operation); + + if (strcmp(operation, "X++") == 0 || strcmp(operation, "++X") == 0) { + count += 1; + } else if (strcmp(operation, "X--") == 0 || strcmp(operation, "--X") == 0) { + count -= 1; + } + } + + printf("%d\n", count); + + return 0; +}