From 4f0fdefc555aedd75a6c64de0d047c147a0f90ac Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Fri, 18 Mar 2022 11:52:18 +0100 Subject: [PATCH] DSA --- du3/program | Bin 6706 -> 6614 bytes du3/program.c | 13 +++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/du3/program b/du3/program index ce4f779f3a9623180b218010321cd9395185c34d..dcd47620edfc56a5db916e60e1106c0a337677b8 100755 GIT binary patch delta 2924 zcmY*bYiv|S6rQm=u%`Ochk=FH5Q zGxy8;Pv6%XDcqXYt^0)#Cp{Iin`k(? zy1IxnEy~IKHrB*597MZ;&`nIM@6xRTIIzfpJ>&?`PmW-hq_0>5dtp%DeK{;db9yM7 z%{F$`8Uv{*kfwXAXS(UnZrKNh;5J(#U`#=_gzl@@z0?Q0Yze2S;@G8AHs*9yjQdiT zjX7;qgt!BE+STWpE~NVh7cN~~)z^rTm+)CsQB~KVTLbEQSMtFa^e0F0NoUN>+V$>E zme~oqky|-U4bW zOX>(rV0hs0KiMpB0at zOr}%L)bg@I5Iu0fw76Ufk4cy^iu1kA&dAxahUEEUn1|AIPCGX?!*Nr0JZJRlaywcV zqy6dcY}Q_VZ+H2!Y1xV;0}mkn`tB`3xba?zHg8ByZ8@Z4;|5+-Hk_doCgZg2^{yA{$mS9k!97otS2O!7dYZ&Jsc$<>eL&dB-5ZLW; zL|p-@1ihxpttHEOKkQw}X?S7mtY4QA$fOsaB#4T55imwGFJ(iC~~~?#Gr4hP_1x1&>t==L|=nVKk9zn zC$W=-W5vACJv^RrHK%Y=ltG4%96Yi^yE|lEv|cQQf!529bxplr_^MvHp=OmbM^u+y zhm9sSS>)VKP1N$#?UulIJE#?O_0X;naZOHA7m7maWRb^UK6I*IixO^T!WqQ2Qn|e` zH}hjU4q~mE2Gj=B2INssdt(OA`GDHuO&H9Cb84SA;qFJT9~yD>1N51lIxbQ|?Z7-9 zpT|8FlBtj^RAYTHgKyea^_VYVGJpFGwb3`u%%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?FgQl@d%!k>a_oYVLrhGmjebJ&Tv0=v-5pbaa~KP7iwZA6Jc7tUX$=K1+F0EPpd!F#C%MQZbbipx(Rdv z=mJnc-5H3Pb3k*dE08dm0!wOtAmL+D+=4`_dI=It%cS}Z_&r$lptdsV8u{i8$$_;-aXF1)~mEgi#DoO;rWKz6lpP+Pzf{Y zg-F7jM2&n;or~=7aizl&K)Zr5;e(7}8YE_OZ!&QFDlS??lzBQ9p$yWPgctbe!L zxS0K-SA;LeW#F@oQEmbrS>|BAC@wrsV}ZgiF$-RV?~BwUY;Me=?a{NjvQ|y%9R6bI zTDkh0&^365e{9nLjo!s}qnexpwX^75t#osyReQRoMRJuYW@eK8@ed&dzUlZ+z(Co%gh*RI%aD{|76!T@C;M diff --git a/du3/program.c b/du3/program.c index bab8fe0..c852917 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,21 +1,18 @@ #include int main(){ - int vxod[999]; + float vxod[999]; int i = 0; - int result = 0; + float result = 0; while(1){ - int value = 0; - int r = scanf("%d",&value); + float value = 0; + float r = scanf("%f", &value); if(r == 1){ vxod[i++] = value; - }else if(r < 1 && vxod[0] < 1){ - printf("Vysledok je: 0.60\n"); - break; }else{ for(int a = 1; a < i; a++) result = vxod[0] * result + vxod[a]; - printf("Vysledok je: %d.00\n", result); + printf("Vysledok je: %.2f\n", result); break; } }