From 985c5028e19df456f3e61f8bea5a482dfb5415a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Fri, 26 Nov 2021 14:58:55 +0100 Subject: [PATCH] prvy --- a2/program.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); }