diff --git a/a2/program.c b/a2/program.c index 53e6caa..3a8dd13 100644 --- a/a2/program.c +++ b/a2/program.c @@ -20,7 +20,7 @@ int main(){ if (r[0] != '{' || r[0] != '(' || r[0] != '[' || r[0] != '<') { //i = n - 2; - hej = 1; + //hej = 1; //puts("halo"); } @@ -59,7 +59,13 @@ int main(){ a = n; i = n - 1; } - //hodnota = 0; + else if (a == n - 1 && hej == 0){ + hej = 4; + printf("Read: %s", r); + printf("Missing closing brackets: }\n"); + i++; + } + //hodnota = 0; } } else if (hodnota == 2){ @@ -78,6 +84,12 @@ int main(){ a = n; i = n - 1; } + else if (a == n - 1 && hej == 0){ + hej = 4; + printf("Read: %s", r); + printf("Missing closing brackets: )\n"); + i++; + } } } else if (hodnota == 3) { @@ -99,6 +111,12 @@ int main(){ i = n - 1; } + else if (a == n - 1 && hej == 0){ + hej = 4; + printf("Read: %s", r); + printf("Missing closing brackets: ]\n"); + i++; + } } } else if (hodnota == 4){ @@ -117,6 +135,12 @@ int main(){ a = n; i = n - 1; } + else if (a == n - 1 && hej == 0){ + hej = 4; + printf("Read: %s", r); + printf("Missing closing brackets: >\n"); + i++; + } } }