From 4912721692c7965e7d7acf866489ca1e841d303d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Sep 2020 22:00:48 +0200 Subject: [PATCH] aaa --- cv1/program.c | 62 ++++++++++++++++++++++-------------------------- cv1/program.exe | Bin 46105 -> 45485 bytes 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/cv1/program.c b/cv1/program.c index 5d57071..0f035c9 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -10,14 +10,13 @@ struct pizza { float prize; char name[LINESIZE]; }; - -int main(){ - //struct pizza tuniakova; - struct pizza nulova; - struct pizza tuniakova = { +struct pizza nulova; + struct pizza tuniakova = { .name="Tuniakova", .prize=2.3 }; + +int main(){ int POCET_JEDAL=0; // Nastavíme všetky bajty pamäte na nulu // Alebo staticky priradime nejake hodnoty @@ -25,44 +24,38 @@ int main(){ // Pozor, táto inicializácia funguje iba na novších prekladačoch 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); - } - } - //float value = strtof(line);//line2 - //if (value == 0.0F){ - // return 0; - //} - //item->prize = value; - //strcpy(item->name, line); - /*return 1; - struct pizza item; - int counter = 1; - while(read_pizza(stdin,&item)){ - counter += 1; - printf("%s",item->name); - printf("%.2f",item->prize); - }*/ - //printf("%s má cenu %.2f\n",item->name,item->prize); - //char hacker_script(char c); + // 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é. return 0; } + int search_string(const char* heap, const char* needle){ + int pole[5]="abcde"; + for (int i = 0; i < 5; i++){ + printf("%c",pole[i+1]); + } + } + + int read_pizza(struct pizza* item){ + float value = strtof(line,struct pizza **); + // Ak je návratová hodnota nula, premena reťazca sa nepodarila. + if (value == 0.0F){ + return 0; + } + item->prize = value; + strcpy(item->name, line); + return 1; + } + char hacker_script(char c){ char numbers[] = "0123456789"; char letters[] = "oizeasbtbq"; @@ -73,6 +66,7 @@ int main(){ } } } +} //////////////////////// // ///////// // //////// ////// diff --git a/cv1/program.exe b/cv1/program.exe index 18e5301ee4fa7e2cf0bc501d78bc370a7698bff2..8bb447710464391414123c86f4d43723951be22d 100644 GIT binary patch delta 7668 zcmcgwc~q1~wy*l=ZU~Ds2uKv6rCSkXX_YX>CAPA-;8RpWoVc{8h#C-=)~J)%M8Mbr z+HhUs61R}ZI8H`wk}-)BQH(Nq`i}9K=R9K^6OCz=Oo%Z)CmQ?xs#iWa^H1iS_i=93 zSHJq*TeoiAs;`=DcIl7TCF{EG53ZVwtemm$IAhnCKM&%Ph7DkhO{&|MA(eh!cR5LV zq@=@sgUP_7mFabi-Kgu;gRIp7JfB|U6S#&x;|W|%|3qo0UQ*A9na!#5=M8GEFJ zB`ZWllcaup60MdJp!SZGKyOQ7bXDrcr_g<1D=5}4fv=(*zXZzm3!~M3-S}$S;J)wWvvgFEDgBf}zbFQVG^aSb(aY?N zhAA_8z6zw`Q^&2(A3Gc!3@8MnkgUo`o=5K}`(<4cyf%eh>(AKUhCBnaD0KFMP_P#J z0nwBjSXJ|~v34_f)sc;Yptk3PKm9Oj|^)E0|(ZE#}4zOgmTCQ2noXNf+oQA1@d9GTlidbF^f@S|h5)}vJhku|3_Mzzb-ydFT zR@*;Iq;ml&Jc=F$q?zY991anxtBDAyJJ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