From 73a040fa6bfd459036068f0d9b7d0c98d9ba93cd Mon Sep 17 00:00:00 2001 From: Peter Sabol Date: Thu, 31 Mar 2022 10:21:27 +0200 Subject: [PATCH] funguje --- du3/program.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/du3/program.c b/du3/program.c index 1e4791c..67878c3 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,10 +1,24 @@ #include -#include #include +#include +#include +#include +#include #define LINE_SIZE 100 + //#include + +float program(float polynom[], float n, float k){ + float result = 0; + for(int a = 0; a < k; a++){ + result = result * n + polynom[a]; + } + return result; +} + + /*void main() { int degree,x; int coeff[10], i; @@ -37,9 +51,15 @@ */ int main(){ - int pole[LINE_SIZE]; - int n=0; - char*vstup; + float pole[LINE_SIZE]; + //double n; + float n; + int m; + int a=0; + int b=0; + memset(pole,0,LINE_SIZE*sizeof(float)); + + /*char*vstup; char riadok[LINE_SIZE]; do { vstup=fgets(riadok,LINE_SIZE,stdin); @@ -48,5 +68,45 @@ int main(){ //printf("%s",*vstup); for(int i=0;n>i;i++){ printf("%s",vstup); + }*/ + int p = scanf("%lf",&n); + + if(1 != p){ + return 1; } + for(;b