From 4656ad58f7f0bab827f346aa03f19fe45af218f2 Mon Sep 17 00:00:00 2001 From: Mikita Sidarenka Date: Tue, 5 Apr 2022 11:47:01 +0000 Subject: [PATCH] Add 'du2/program.c' --- du2/program.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 du2/program.c diff --git a/du2/program.c b/du2/program.c new file mode 100644 index 0000000..54290cd --- /dev/null +++ b/du2/program.c @@ -0,0 +1,56 @@ +#include +#include +#define VELKOST_POLA 40 +void error(); +int main(){ + int value=0; + int pole[VELKOST_POLA]; + memset(pole,0,VELKOST_POLA * sizeof(int)); + int i =0; + while (i0){ + idx=idx+1; + } + } + int f=0; + if (idx<5){ + error(); + return 0; + }while(pole[f]!=0){ + break; + printf("Súťažiaci č. %d vypil %d pohárov.\n", i+1, pole[i]); + } + printf("%d",idx); + int n=0; + while (pole[n]!=0){ + n=n+1; + if (pole[n]<0){ + break; + } + if (max_hodnota