From 12e7288a76a1050004e2a4815354dabc152bc553 Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Wed, 9 Mar 2022 13:53:51 +0100 Subject: [PATCH] SAD --- du2/.program.c.swl | Bin 0 -> 4096 bytes du2/.program.c.swm | Bin 0 -> 4096 bytes du2/.program.c.swn | Bin 0 -> 12288 bytes du2/.program.c.swo | Bin 0 -> 12288 bytes du2/program | Bin 5446 -> 5522 bytes du2/program.c | 36 +++++++++++++++++++++++++----------- 6 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 du2/.program.c.swl create mode 100644 du2/.program.c.swm create mode 100644 du2/.program.c.swn create mode 100644 du2/.program.c.swo diff --git a/du2/.program.c.swl b/du2/.program.c.swl new file mode 100644 index 0000000000000000000000000000000000000000..ee5b49d4711b8e2b28dcfb04c32d423262f44227 GIT binary patch literal 4096 zcmYc?2=nw+FxN9-00IF9hP8_{lGLa3GUT{3FjVFnn-~@6f@JW5{M^*^M7$~>l66o6 z^$W_fl8ub?Q%a5W3ySj7ixPA7l8Mkis$?_-Mniy-5a4AnHZn9&R#H?D77C@rpi#Y} fAut*OqaiRF0;3@?8UmvsFd71*Aut*OLofsY8=n>P literal 0 HcmV?d00001 diff --git a/du2/.program.c.swm b/du2/.program.c.swm new file mode 100644 index 0000000000000000000000000000000000000000..0339d0975bbc5e90c907233be8acfe47ebb014ca GIT binary patch literal 4096 zcmYc?2=nw+FxN9-00IF92DL>RNov!185~?07%KCPO^k|jK{9wjer{@dB3=~`$vUWk z`UPcK$wo%{DWyjG1x5MkMTxn3$wcTMRWcd^qai>^2=Fo(8yOlXD=8`n3x!f*(5T+g f5Eu=C(GVC7fzc2c4S~@R7!85Z5Eu=CAs7Mx$H5gn literal 0 HcmV?d00001 diff --git a/du2/.program.c.swn b/du2/.program.c.swn new file mode 100644 index 0000000000000000000000000000000000000000..387c26b4478073e6caaaee729af9a25e51a91e4b GIT binary patch literal 12288 zcmeI1O=}ZD7{{l2kUdnzoO)nnwkQV&_7EgWy{S5k_-4v5ck>1p2;K%ID^D;BPW3o~xU%5`_?HPe_ zREQIu+{&qE!{Xb#5G{XtrWn;tWY6K()vDYxBMm<8HOvRiwMwy=cN)cf5c;d3tlO18 zsOJ0D)nNb=!w!F_qT*e0202^QfY=8~00XDz}*udXvAP$Da zPh9>0I1Yw-VB*0B*Z><~18jf|umLu}2G{@_U;}J`4g4bpq$9-Uun?n%@gV&FZ+-*# zaYTq6@CAGZufYrO6g&YfPy<)NEI0_hqy8)S2sS|nJO`J+IZy;P$O3cLNiYHqfgPOx z3A_WZz)P?Jc(4IBzy{a=8(;%$fDNz#Hoyk{KLhQyXs2Kr_)6FPv4OZL8yLL}Od{#I z8|+W)|3;n_s<;t)RG1Z3+Y*+AEz4R7mAsD~%L+p6#noKqhTK~3zKNx$6-AOf75I(} zwd>ndrXW;x<#}q2n$m43@}pR~l7jBrrtf&&4%IOEv9#%qml-#G+scj9BXfYBm`Dz? z>hd9#C{$6yjicN8ZnCSZIkP|4w?A&G29pbE^6y$SN^X+$*nPrM_x<*U-2R|tMbp;0 zO=Auquh_5=4Yzx)+wd~C5yjzFtb%&)5BjkL z0uY!`AWQpa&z05}-Bz&h=B5lE*>X(F3JD@&wm5>Hcj+J@>%jp@=kIf zc`11!c_gut+mcg~X~`SuKajkVypZJk?MVg_6a*ju0SG_<0uX=z1Rwwb2>eF^yAu>S zu}-tta#-{yh`MUb>c=S3|)@V)?TOEa-ij5!ExywqbVx44un%prPkFS}GRw&!P_ O=JQGFnXo>%KtBM#d$RZd literal 0 HcmV?d00001 diff --git a/du2/program b/du2/program index b366fc74ab58380bb18ad97eeafcbbe8b89c1349..bd1f49d08b96d5fd7de7bf4e37864cc9ee1b376f 100755 GIT binary patch delta 2570 zcmZWrZERCj7(TbXw`;q$tlj21`DjPG4Hf1HB8vn0T1?P{4EI40V<@oMDY`kg5h7Y< zH()kPz+<9>goH5S5=Tc(oqyr?5I5jc+;0MN%bh?=tGJ^)K&vS3PE%79$?|I(u z^Pcy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PjK^D?w1Mf|4F(vPJ_C$VSq&@%qrw_k zB_YnmOl3AOv5`d>RohSyEg7SF8yMN5QN;~BM_{VAfr-+__shUUJ;tcs z1||v`1UE2I5d=@u%_68<#~78~n1C+?n#o5CdrDv`KMgE`<5+M87YI9*->}ntBHHxi zJQp!nmDpTH`pNXRWaeb0z*_ol5?)7Mv+#DpSe5RHgj=~A(o9=I+I_%BXU#taOyq*V zd^f{`%-6UU?J9rY)a9}f*kHO*~x-X@8IJukN5^biHGN*9)s3A$6Pjt_0p_#*>X^xeqgiFshydHHQ+CS z8`AS#av@6skAepj)rAP(&zevElM)dN6M_J_s4!l2);JUJp>6{<4FPf&IBOEnwU PZ+K&6X&L`2?}vW?nle1k diff --git a/du2/program.c b/du2/program.c index 7ebca92..97e811c 100644 --- a/du2/program.c +++ b/du2/program.c @@ -1,19 +1,33 @@ #include -#define VELKOST_POLA 52 +#define VELKOST_POLA 50 int main(){ - int results[50]; + int results[VELKOST_POLA]; int max; - int vysledky[VELKOST_POLA] = {0,0,0,0}; + //int value = 0; int i = 0; - printf("1 2 3 4 5"); + int a = 0; while(1){ - scanf("%d", results[i]); - if(results[i] == 1) - printf("Úspešne som načítal hodnotu %d\n",results[i]); - else - printf("Načítanie sa nepodarilo. V premennej value ostala pôvodná hodnota. \n"); - i++; - } + int value = 0; + int r = scanf("%d",&value); + if (r == 1){ + printf("Úspešne som načítal hodnotu %d\n",value); + results[i] = value; + max = results[0]; + if(max < results[i]) + max = results[i]; + i++; + }else{ + do{ + printf("Súťažiaci č. %d vypil %d pohárovav.\n", results[a], results[a]); + if(a == i - 1){ + printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", max, max); + break; + } + a++; + }while(a < i); + break; + } + } return 0; }