#include #include #include #include #define LINESIZE 100 #define LINE_SIZE 100 #define POCET_JEDAL 10 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); struct pizza item; while(read_pizza(&item)){ strcpy(jedalny_listok[counter].name, item.name); jedalny_listok[counter].prize=item.prize; counter += 1; //printf("%d\n",counter); if (counter>=POCET_JEDAL) { break; } } for(int i=0;iprize = value; strcpy(item->name, line); return 1; } 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]; } } return tolower(c); }*/ //////////////////////// /// ///////// // ////// /////// // /////// /////// // /////// /////// // ////// //////// // //// ////////// // //////////// // /// /////////// // //// ////////// // ///// ///////// // ////// //////// // //////// /////// ////////////////////////