Update 'cv3/program.c'
This commit is contained in:
parent
72c07053cd
commit
9cee0d1287
@ -19,15 +19,14 @@ int main() {
|
|||||||
double coefficients[MAX_COEFFICIENTS];
|
double coefficients[MAX_COEFFICIENTS];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
|
||||||
printf("Enter the value of x: ");
|
|
||||||
fgets(buffer, BUFFER_SIZE, stdin);
|
fgets(buffer, BUFFER_SIZE, stdin);
|
||||||
if (sscanf(buffer, "%lf", &x) != 1) {
|
if (sscanf(buffer, "%lf", &x) != 1) {
|
||||||
printf("Nepodarilo sa nacitat zaklad x\n");
|
printf("Nepodarilo sa nacitat zaklad x\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Enter coefficients from highest to lowest degree, finish with an empty line:\n");
|
|
||||||
while (fgets(buffer, BUFFER_SIZE, stdin) && buffer[0] != '\n') {
|
while (fgets(buffer, BUFFER_SIZE, stdin) && buffer[0] != '\n') {
|
||||||
if (sscanf(buffer, "%lf", &coef) == 1) {
|
if (sscanf(buffer, "%lf", &coef) == 1) {
|
||||||
coefficients[count++] = coef;
|
coefficients[count++] = coef;
|
||||||
@ -46,3 +45,4 @@ int main() {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user