diff --git a/a2/program.c b/a2/program.c index 75e7755..4b6372c 100644 --- a/a2/program.c +++ b/a2/program.c @@ -18,6 +18,11 @@ int main(){ //printf("%ld", n); while(r[i] != '\n'){ //puts("1"); + if (r[0] != '{' || r[0] != '(' || r[0] != '[' || r[0] != '<') { + i = n - 2; + hej = 1; + //puts("halo"); + } if (r[i] == '{') { hodnota = 1; i++; @@ -116,10 +121,11 @@ int main(){ } } if (hej == 1){ - printf("Read: %s\n All brackets OK", r); + printf("Read: %s", r); + puts("All brackets OK"); } if (hej == 0){ - printf("Read: %s\n Crossed bracket OK", r); + printf("Read: %s\nCrossed bracket OK\n", r); //printf("%s\n", r); }