From cce7b87f42680609b964c3dbb930fffb0b8ef221 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Sep 2020 19:23:12 +0200 Subject: [PATCH] ok --- cv1/program.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ usaa20 | 1 - 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 cv1/program.c delete mode 160000 usaa20 diff --git a/cv1/program.c b/cv1/program.c new file mode 100644 index 0000000..22f895d --- /dev/null +++ b/cv1/program.c @@ -0,0 +1,46 @@ +#include +#include + +#define LINESIZE 100 +#define LINE_SIZE 100 + +struct pizza { + float prize; + char name[LINESIZE]; +}; + +int main(){ + int POCET_JEDAL=0; + struct pizza jedalny_listok[POCET_JEDAL]; + // Na začiatku celé pole vynulujeme, všetky pizze sú nulové + memset(jedalny_listok, 0,sizeof(struct pizza)*POCET_JEDAL); + struct pizza *prva = jedalny_listok; + struct pizza *druha = jedalny_listok + 1; + struct pizza *tretia = &jedalny_listok[2]; + int read_pizza(struct pizza* item); + + char line[LINE_SIZE]; + while (1){ + // Inicializujem pamäť + memset(line,0,LINE_SIZE); + // Do poľa načítam max. LINE_SIZE znakov zo štandardnéhgo vstupu. + char* r = fgets(line,LINE_SIZE,stdin); + // Overím si či bolo načítanie úspešné. + if(r != NULL && line[1] != 0){ + // Načítanie je úspešné ak fgets vráti nenulovú hodnotu a načítaný reťazec je dlhši ako jeden znak + printf("%s",line); + } + } + //printf("%s má cenu %.2f\n",item->name,item->prize); + char hacker_script(char c); + return 0; +} +char hacker_script(char c){ + char numbers[] = "0123456789"; + char letters[] = "oizeasbtbq"; + for (int i = 0; i < 10; i++){ + if (c == numbers[i]){ + return letters[i]; + } + } +} \ No newline at end of file diff --git a/usaa20 b/usaa20 deleted file mode 160000 index 86d0eb0..0000000 --- a/usaa20 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 86d0eb084f079ed2253d41ca6f1233a2ff09baca