Изменить 'a1/program.c'
This commit is contained in:
parent
0e2afeb87e
commit
85a0be07ef
@ -15,11 +15,20 @@ int main () {
|
|||||||
if (!strcmp("\n", input))
|
if (!strcmp("\n", input))
|
||||||
break;
|
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++)
|
for(int j = 0; input[j] != '\0' && input[j] != '\n'; j++)
|
||||||
if(!isdigit(input[j]) && input[j] != '.'){
|
if(!isdigit(input[j]) && input[j] != '.'){
|
||||||
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i);
|
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0){
|
if (i == 0){
|
||||||
x = (double)strtod(input, &ptr);
|
x = (double)strtod(input, &ptr);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user