diff --git a/cv2/program.c b/cv2/program.c index d1ae915..688ac0f 100644 --- a/cv2/program.c +++ b/cv2/program.c @@ -19,38 +19,32 @@ 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; + //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; - } + if (counter>=POCET_JEDAL) + { + break; } } - //printf("%d\n",counter); + for(int i=0;i