2025-03-06 15:13:43 +00:00
|
|
|
#include <stdio.h>
|
2025-03-06 16:04:09 +00:00
|
|
|
#include <string.>
|
2025-03-06 15:13:43 +00:00
|
|
|
|
|
|
|
int main(){
|
2025-03-06 15:16:29 +00:00
|
|
|
double koef=0;
|
2025-03-06 15:13:43 +00:00
|
|
|
double a;
|
|
|
|
double rishennia;
|
2025-03-06 15:23:23 +00:00
|
|
|
int i=1;
|
2025-03-06 15:13:43 +00:00
|
|
|
if (scanf("%lf",&a) != 1) {
|
2025-03-06 15:39:54 +00:00
|
|
|
printf("Nepodarilo sa nacitat zaklad x\n");
|
2025-03-06 15:38:55 +00:00
|
|
|
return 0;
|
2025-03-06 15:16:29 +00:00
|
|
|
}else{ while (scanf("%lf", &koef) == 1) {
|
2025-03-06 16:04:09 +00:00
|
|
|
if(strlen(koef) !='\0'){
|
2025-03-06 15:13:43 +00:00
|
|
|
rishennia=rishennia*a +koef;
|
2025-03-06 15:24:10 +00:00
|
|
|
i++;
|
2025-03-06 16:04:09 +00:00
|
|
|
}else{ printf("Vysledok je: %.2f\n", rishennia);
|
|
|
|
return 0; }
|
2025-03-06 15:13:43 +00:00
|
|
|
}
|
2025-03-06 15:28:47 +00:00
|
|
|
if (feof(stdin)) {
|
2025-03-06 15:29:41 +00:00
|
|
|
printf("Vysledok je: %.2f\n", rishennia);
|
2025-03-06 15:28:47 +00:00
|
|
|
|
2025-03-06 15:35:01 +00:00
|
|
|
} else { printf("Nepodarilo sa nacitat polynom na %d mieste.\n",i);
|
2025-03-06 15:23:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
2025-03-06 15:13:43 +00:00
|
|
|
}
|