diff --git a/cv3/ program.c b/cv3/ program.c index e69de29..acb8be8 100644 --- a/cv3/ program.c +++ b/cv3/ program.c @@ -0,0 +1,25 @@ +#include + +int main() { + float x; + float coefficient; + float result = 0; + int exponent = 0; + + + if (scanf("%f", &x) != 1) { + printf("Chyba\n"); + return 1; + } + + + while (scanf("%f", &coefficient) == 1) { + result += coefficient * pow(x, exponent); + exponent++; + } + + + printf("Vysledok je: %.2f\n", result); + + return 0; +}