diff --git a/du1/program.c b/du1/program.c new file mode 100644 index 0000000..0fd4159 --- /dev/null +++ b/du1/program.c @@ -0,0 +1,24 @@ +#include + + int main(){ + int counter=0, Sym; + char OutSym; + + while(1){ + Sym=getchar(); + if(Sym=='\n'){ + counter++; + } + if(Sym==EOF){ + //counter++; + break; + } + else if(Sym<='Z'&&Sym>='A')Sym +=32; + else if(Sym<='z'&&Sym>='a')Sym-=32; + //counter++; + OutSym=Sym; + putchar(OutSym); + } + printf("\nPočet riadkov: %d\n",counter); + return 0; +} \ No newline at end of file diff --git a/du2/program.c b/du2/program.c new file mode 100644 index 0000000..85e879a --- /dev/null +++ b/du2/program.c @@ -0,0 +1,47 @@ +#include +#include +#define VELKOST_POLA 90 + + +int main(){ + + int value = 0; + int count = 0; + + int pole[VELKOST_POLA]; + memset(pole,0,VELKOST_POLA*(sizeof(int))); + + int max_hodnota=0; + int idx=0; + while (1){ + int r=scanf("%d",&value); + if(r!=1 || idx==VELKOST_POLA || value < 0){ + break; + } + pole[idx]=value; + if (pole[idx] > max_hodnota){ + max_hodnota = pole[idx]; + } + idx++; + count++; + } + + if (count==0){ + printf("Chyba: Málo platných hodnôt.\n"); + return 0; + } + + for(int i=0; i0){ + printf("Súťažiaci č. %d vypil %d pohárov.\n", i+1, pole[i]); + } + } + + for(int i=0; i