solutions: 282A

This commit is contained in:
Muhammad Nauman Raza 2025-01-17 23:04:06 +00:00
parent bdb9534633
commit fe9f857c2b
Signed by: devraza
GPG key ID: 91EAD6081011574B

26
solutions/clang/282A.c Normal file
View file

@ -0,0 +1,26 @@
#include <stdio.h>
#include <string.h>
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;
}