From 85a0be07efccd6ad0cf1d341a5a1ef033f3ebb97 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Thu, 18 Mar 2021 19:46:41 +0000 Subject: [PATCH] =?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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/a1/program.c b/a1/program.c index 510d095..c396463 100644 --- a/a1/program.c +++ b/a1/program.c @@ -15,11 +15,20 @@ int main () { if (!strcmp("\n", input)) break; + if(i == 0){ + for(int j = 0; input[j] != '\0' && input[j] != '\n'; j++) + if(!isdigit(input[j]) && input[j] != '.'){ + printf("Nepodarilo sa nacitat zaklad\n"); + return 0; + } + } + for(int j = 0; input[j] != '\0' && input[j] != '\n'; j++) if(!isdigit(input[j]) && input[j] != '.'){ printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i); return 0; } + if (i == 0){ x = (double)strtod(input, &ptr); }