From dcbdb296150e94b6389336674a6dbaf7844b4c78 Mon Sep 17 00:00:00 2001 From: Kapliuk Date: Wed, 6 Mar 2024 17:59:11 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D0=B8=20'c?= =?UTF-8?q?v3/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv3/program.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cv3/program.c b/cv3/program.c index 53c5fdf..96b43dc 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -1 +1,21 @@ #include +#include +#include +#include +#include +#define MAX_I_LINE_LENGTH 256 +int main(){ + char line[MAX_I_LINE_LENGTH]; + int cfIdx = 0; + double x, cf,result = 0; + fgets(line, 100, stdin); + x = strtod(line, NULL); + while(line[0] != '\n'){ + result = result * x + cf; + fgets(line, 100, stdin); + cf = strtod(line,NULL); + } + printf("Vysledok je: %.2f\n", result); + return 0; + +} \ No newline at end of file