From aa4e55d2e938123dace65054d9fbc5edaa549107 Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Wed, 9 Mar 2022 14:14:04 +0100 Subject: [PATCH] DSA --- du2/program | Bin 5566 -> 5614 bytes du2/program.c | 12 +++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/du2/program b/du2/program index 1079ef8ca9e667c99ac10368f3805e3da0f963f0..b425e87fc3635c1033e4fda3fa40a5c097c48294 100755 GIT binary patch delta 1480 zcmYjRU1(cn7=FL=lbpCD>p5xKRBMwaX*Vcttzs+H;U)n^cCpPk@j~fzj9iE)E;^x@ zl_ZW33oW0h0YL|2OzVZ3GIk;EC(bh1Mcs`Ey*OeDCoYr9bX1wf=RHZJADr{N|L^mC z=X=k$W510p#KcpJ!!O@&dx`kb39E-l09@OLnqe=V?)Np}Y(i-+UY@!~gQA_%4DFOu z#GAc))0>08oDam7&U_yFdr#lw#B}*r`JPx7vvQwOeQfO`&G4v52YOL>gHa*+gAw*k zMvdq$BM3Z`ZyHV&1m;G)(98Ou&=S|>RdR3O;F>K zt8;@)g!M07of~ChtbYo9;?|3$pY!#N1L;GVnRnsYC~C&R!L`a z#sdak`AyGT%I(?(q*L+I@jss}t>>GO6)nlm*6Ov|!u;`3y1*LZwHf4QCcjzSr3%uHCL3TR83Dpiz6M+a&yd6GwimMRN{U!CEOK>urfvQpsKx z=YgeEQUjrr*o<@j-&U(sNZN4azi~lipDw49z2!oZ%aqcENI8{^Af^emV=bo&kw@E> zcdRY8c2th??PPJYgrY8+tci{V?ifbL#;e#8@|YdhD!=cF`6~k4j8fX=cZQ>X{KpOC z8hJ;cC#Ph0baLkp2uMt9OWyT3Cw_v&n-LJ<1dd`vK3AG8$|ZepU>zZIwRH=nn}g+7 zlH>DL4ZIvv+WPb24LR*O>)U^~)k-1doNRce1j%7FICV2w(1&yNeL_k*`l+StJ z9yp4=12Eh8Jof=LJonyYY@`sGZ(uk%H44TnK!jV^d9yi@lfl=W2j{)m4Y)0_`9yWI$S?e$rV7dxlmx-V-t#NFJ z8G-pN=zOpM)as)bv9!v1N0rtvodQ%E&k6OL5xK~BK!~i6?xVg8sSgDH_JrT5X@V9M4|J4 RX;L<av0OyoT169(ek`Pu_m^wDVFT@lI%zUsokH!3nMSz-r#GOda7sFA}c_YDDJ+ zVgE|dAo@lS1RhUsTa6+J%vaMK*9TK2IGRIc{0qD0kR)y9)8`Y)7nPDo6hW)(X*gxTVz86nv zSi)X=P%JbXbYrc?9Ex1blbODBOH|iB#}+sDtd01j z#2-ccwfC@D3gyN#eYrPdDUs9X6zW*nq+4r7_U^&n-L&b3y1x}OJM!P)|Hqz^*l+(t zoe-FaU+sn~If?%~!7mz+}5G_hKx*STr!lMuL6jQ|f(w!Thje z?vG}390@i#>>X2ap7ch84horay%V;zpdIP*=o+8&z8XFZ7GanRnEf3S7 zM^%BRtdy!0FIyk$D#MGN5sw5M=F^=~&oM~H_+n?&tV61staS}~=p>Gq4|GL6lCi*( zkV=qBka~HktJ5Q=T;>(n-G{{+kmRkb@=b|?RN$~3HEWP+79X((-8-@gcaZ1oZf(=z zH|$~MGFR6Zpc=5vM1jdA*}Kb(!2CLNnJoah_R+7vc4y-6 zz&&UaQxu{I^f>SMN3~j>hXehC?mI=0k8U;>;B1dIfU)MFW7~A#kiWj$j9&}Wd6*~o zgFqx8-;pT<2goME_wG`je+cvs$x+DV@*`^y=6~0SK$q{1$>HFLwwW&;4SuBk4Iz)9 A=Kufz diff --git a/du2/program.c b/du2/program.c index aa61dd8..56e5707 100644 --- a/du2/program.c +++ b/du2/program.c @@ -3,8 +3,7 @@ int main(){ int results[VELKOST_POLA]; - //int max; - //int value = 0; + int max; int i = 0; int a = 0; while(1){ @@ -12,9 +11,9 @@ int main(){ int r = scanf("%d",&value); if (r == 1){ results[i] = value; - //max = results[0]; - /*if(max < results[i]) - max = results[i];*/ + max = results[0]; + if(max < results[i]) + max = results[i]; i++; }else if(i == 0){ printf("Chyba: Málo platných hodnôt.\n"); @@ -25,8 +24,7 @@ int main(){ do{ printf("Súťažiaci č. %d vypil %d pohárov.\n",a+1,results[a]); if(a == i - 1){ - //printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", a+1, results[a]); - printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",a+1,results[a]); + printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",a+1,max); break; } a++;