#include #include #include #include #define LINESIZE 100 #define LINE_SIZE 100 #define POCET_JEDAL 100 struct pizza { float prize; char name[LINESIZE]; }; void trim(char* str); int search_string(const char* heap, const char* needle); int read_pizza(struct pizza* item); char hacker_script(char c); int main(){ struct pizza jedalny_listok[POCET_JEDAL]; memset(jedalny_listok, 0,sizeof(struct pizza)*POCET_JEDAL); int counter=0; char line[LINE_SIZE]; memset(line,0,LINE_SIZE); printf("Zadaj hladanu surovinu:\n"); char* r = fgets(line,LINE_SIZE,stdin); trim(line); if(r != NULL && line[1] != 0){ printf("Zadaj jedalny listok:\n"); struct pizza item; while(read_pizza(&item)){ strcpy(jedalny_listok[counter].name, item.name); jedalny_listok[counter].prize=item.prize; //printf("%s",jedalny_listok[counter].name); //printf("%s",item.name); counter += 1; printf("%d\n",counter); if (counter>=POCET_JEDAL) { break; } } } //printf("%d\n",counter); for(int i=0;iprize = value; strcpy(item->name, line); return 1; } } 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]; } } return tolower(c); } //////////////////////// // ///////// // /////// /////// // //////// /////// // //////// /////// // ////// //////// // //// ////////// // ///////////// // /// /////////// // //// ////////// // ///// ///////// // ////// //////// // /////// /////// ////////////////////////