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

This commit is contained in:
Oleksandr Hryshchenko 2021-03-18 19:40:19 +00:00
parent 52c345db5e
commit dcb544fd87

View File

@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
int main () {
char* input = (char*) calloc (100, sizeof(char));
@ -14,6 +15,11 @@ int main () {
if (!strcmp("\n", input))
break;
for(int j = 0; input[j] != '\0' && input[j] != '\n'; j++)
if(!isdigit(input)){
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i+1);
return 0;
}
if (i == 0){
x = (double)strtod(input, &ptr);
}