Изменить 'a1/program.c'

This commit is contained in:
Oleksandr Hryshchenko 2021-03-18 19:46:41 +00:00
parent 0e2afeb87e
commit 85a0be07ef

View File

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