This commit is contained in:
Džubara 2024-10-31 23:42:43 +01:00
parent 3c23edb5f4
commit e2ae3d2773

View File

@ -10,7 +10,7 @@ void check_brackets(const char *code) {
char stack[100]; char stack[100];
int top = -1; int top = -1;
printf("Read: %s", code); printf("Read: %s", code); // Výstup pre načítanie vstupu
for (int i = 0; code[i] != '\0'; i++) { for (int i = 0; code[i] != '\0'; i++) {
char c = code[i]; char c = code[i];
@ -37,7 +37,8 @@ void check_brackets(const char *code) {
int main() { int main() {
char code[100]; char code[100];
fgets(code, 100, stdin); if (fgets(code, sizeof(code), stdin) != NULL) {
check_brackets(code); check_brackets(code);
}
return 0; return 0;
} }