diff --git a/a1/program.c b/a1/program.c index 9715222..cab789f 100644 --- a/a1/program.c +++ b/a1/program.c @@ -21,9 +21,11 @@ int main() { char stack[100]; int top = -1; - //printf("Введіть код: "); + // printf(""); fgets(input, 101, stdin); + printf("Read: %s", input); + for (int i = 0; i < strlen(input); i++) { char current = input[i]; @@ -40,11 +42,11 @@ int main() { return 1; } if (!isMatching(stack[top], current)) { - printf("Crossed bracket '%c' in %d , expected \n", + printf("Crossed bracket '%c' in %d , expected \n", current, i); (stack[top] == '{') ? '}' : (stack[top] == '[') ? ']' : (stack[top] == '(') ? ')' : '>', - current, i); + current, i; return 1; } top--;