From f7fd1370a14977bb0c1660e2f7c2295f7be315ef Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Fri, 18 Mar 2022 12:14:58 +0100 Subject: [PATCH] DSA --- du3/program | Bin 6998 -> 6930 bytes du3/program.c | 13 ++++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/du3/program b/du3/program index 86e0affcc94bf627dd9e169f56b04387da9d9609..f0a512a949346f7925b2a7e240cc51507418c632 100755 GIT binary patch delta 1889 zcmY*aX>3$g6h8MY(>L9inK$jc%E(OVD+6Ka6l$p=F=&xsOaxiP2!@I@Q$Ro%wn#G8 zY0(B7TdpP$QK-QmBw{4PkCN0_Y!wk5eKUe}B| zDa1Dag5#$LPrCMB{9xJbtxwFg@Ad}XIxXK6$3&l;qoigR@6!yI3Tt2i{Dv77BAXHN ziHsW26h`d7D0$sTr?7wPz%OO8R;^6tQ#G6c=jAa z5;WTH@VrCJV*V3{=bd6<<`06ez43g<<>Zw=7A$@`c5oLoQA`V$#y)D(jPz$%AkV4c z`dP4<+JGtfmus7HbD$UI)ZQPzy`zK%v)Ls0$5C4E?qYKs$k6iY|i?0zgA89G0D@zVR79?$c?xMXgoK7MnuyqRNXA^xE9t|Pn+Ic zNK1EYUbp(i4Qs<|RzDQZim(hL@t7E^&YB1cjZ49QGMPr;cG*%eQw+lM7 z=9C)k%A+N^x=H>}u%qG-s#XCpU#zh}w!aUbU$z+Yghw7V5+W#T-J44sYiM|A@~Ar~ z#>=nVYZK$)fo0-%OnM7b8k0)gcD0bup8~DM&xBk}BwShMR7h{-bp?E{)%ait_ZPPB zvdqmgB_4KdB2k#t_lJlKCi!!(1^%j%qG_u@k^H={#S~(`DNHCUX}(#*kH#7~uV}{f zBYoYmc=QM~55W!#jhq8}%1;Sgwx!N_SV z6z94)V;bgt_&C@NslMVpBDJ72s3^A-x!yBQ=XxHJ-JUAF7gVo24l4UJT?Vxhjj~d@ zy;ZvNkjYw5epKEMDj+v{i*>$hmTZOGdEMk;Q2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+@uMo9c7Wd3Xb#B$T0z|6*&x8s~;@)A@?UdThzQ&1&>vZ=sZY(4AnanP+) z54cQGT`1}v$U)g#P~~i%*@;u}&M4>N6)_X@nF{2BOII}y`_ X_Q4grkog~VK-L#76rn_G;b+P}&3g#r diff --git a/du3/program.c b/du3/program.c index a61c14c..d4a3196 100644 --- a/du3/program.c +++ b/du3/program.c @@ -3,23 +3,22 @@ int main(){ float vxod[999]; int i = 0; + int a = 1; float result = 0; while(1){ float value = 0; float r = scanf("%f", &value); - if(r == 1){ + if(r == 1) vxod[i++] = value; - }else if(r == '\n'){ - printf("Vysledok je: %.2f\n", vxod[i]); - }else if(r <= 255 && r >= 0){ + else if(r <= 255 && r >= 0){ if(i != 0) printf("Nepodarilo sa nacitat polynom na %d mieste.\n", i); else printf("Nepodarilo sa nacitat zaklad x\n"); break; - } - else{ - for(int a = 1; a < i; a++) + }else{ + for(a = 1; a < i; a++) + printf("%.2f\n", vxod[a]); result = vxod[0] * result + vxod[a]; printf("Vysledok je: %.2f\n", result); break;