From 6aaaee380f885460026aa63befa392db362fed87 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Sat, 6 Mar 2021 23:55:59 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index d3ec9fb..b86e129 100644 --- a/a1/program.c +++ b/a1/program.c @@ -17,7 +17,7 @@ int main () { x = atoi (BMW); } else { - numbers [i] = atoi [BMW]; + numbers [i] = atoi (BMW); } } int result = 0; From 971d46afb9068e1d40292c57344451b50e523f9a Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Sat, 6 Mar 2021 23:58:45 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index b86e129..4d175bb 100644 --- a/a1/program.c +++ b/a1/program.c @@ -26,5 +26,5 @@ int main () { counter --; } printf ("Vysledok je: "); - printf ("%d\n", result); + printf ("%d\n", &result); } From 29ee493d7c17f457d767ae6515c62d2e84b20963 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Sun, 7 Mar 2021 00:01:20 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/a1/program.c b/a1/program.c index 4d175bb..9d8c5e8 100644 --- a/a1/program.c +++ b/a1/program.c @@ -27,4 +27,6 @@ int main () { } printf ("Vysledok je: "); printf ("%d\n", &result); + free(BMW); + return 0; } From 8f35e46418e91cf33702b2616920e64e3f049c6b Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Sun, 7 Mar 2021 00:03:02 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/a1/program.c b/a1/program.c index 9d8c5e8..51c46a5 100644 --- a/a1/program.c +++ b/a1/program.c @@ -6,10 +6,10 @@ int main () { char* BMW = (char*) calloc (100, sizeof(char)); int x; - int counter; + int counter = 0; int numbers [100]; for (int i = 0; fgets(BMW, 100, stdin) != NULL; i++){ - if (!strcmp("\n", BMW) || !strcmp(" ", BMW)) { + if (!strcmp("\n", BMW) || !strcmp(EOF, BMW)) { counter = i; break; } From 5f8bcc642d9b8e402d04005df8e76d8aba5b8623 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Sun, 7 Mar 2021 00:03:53 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index 51c46a5..c6f6999 100644 --- a/a1/program.c +++ b/a1/program.c @@ -9,7 +9,7 @@ int main () { int counter = 0; int numbers [100]; for (int i = 0; fgets(BMW, 100, stdin) != NULL; i++){ - if (!strcmp("\n", BMW) || !strcmp(EOF, BMW)) { + if (!strcmp("\n", BMW)) { counter = i; break; }