diff --git a/cv1/program.c b/cv1/program.c index 0f035c9..048f6b0 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -36,17 +36,27 @@ int main(){ // 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; + return 0; + } + + struct pizza item; + int counter = 1; + while(read_pizza(stdin,&item)){ + counter += 1; + printf("%s",item->name); + printf("%.2f",item->prize); + } +} int search_string(const char* heap, const char* needle){ - int pole[5]="abcde"; + char pole[5]="abcd"; for (int i = 0; i < 5; i++){ printf("%c",pole[i+1]); } } int read_pizza(struct pizza* item){ - float value = strtof(line,struct pizza **); + float value = strtof(line,struct pizza); // Ak je návratová hodnota nula, premena reťazca sa nepodarila. if (value == 0.0F){ return 0; @@ -60,21 +70,20 @@ int main(){ char numbers[] = "0123456789"; char letters[] = "oizeasbtbq"; for (int i = 0; i < 10; i++){ - tolower(c); - if (c == numbers[i]){ + if (tolower(c) == numbers[i]){ return letters[i]; } } } -} + //////////////////////// -// ///////// +// //////// +// /////// ////// // //////// ////// // //////// ////// -// //////// ////// -// //////// ////// -// // ///////// -// ///////////// +// ////// ////// +// //// ///////// +// //////////// // /// /////////// // //// ////////// // ///// /////////