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); }