From 29ab2de6366fd8748e378ce82d4c9d6c75d310db Mon Sep 17 00:00:00 2001 From: Mykola Syniavskyi Date: Thu, 6 Mar 2025 15:13:43 +0000 Subject: [PATCH] =?UTF-8?q?P=C5=99idat=20du2/program.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du2/program.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 du2/program.c diff --git a/du2/program.c b/du2/program.c new file mode 100644 index 0000000..271821b --- /dev/null +++ b/du2/program.c @@ -0,0 +1,17 @@ +#include + + +int main(){ + int koef=0; + double a; + double rishennia; + if (scanf("%lf",&a) != 1) { + printf("Chyba\n"); + return 1; + }else{ while (scanf("%d", &koef) == 1) { + rishennia=rishennia*a +koef; + } + printf("Vysledok je: %.2f\n",rishennia); + } + return 0; +} \ No newline at end of file