From 6fcfeb82e4d257715c6cbb3aa5a26a32e424f20a Mon Sep 17 00:00:00 2001 From: Nazar Sendetskyi Date: Fri, 18 Mar 2022 12:14:12 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'du3/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du3/program.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/du3/program.c b/du3/program.c index 53c5fdf..9fae9cb 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1 +1,28 @@ #include + +int main(){ + float cislo[999]; + int i, b = 0; + float vysledok = 0; + do{ + float c = 0; + float d = scanf("%f", &c); + if(d == 1) + cislo[i++] = c; + else if(d <= 255 && d >= 0){ + if(i != 0) + printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i); + else + printf("Nepodarilo sa nacitat zaklad x\n"); + break; + }else{ + while(b < i){ + vysledok = cislo[0] * vysledok + cislo[b]; + b++; + } + printf("Vysledok je: %.2f\n", vysledok); + break; + } + }while(1); + return 0; +} \ No newline at end of file