diff --git a/cv2/program b/cv2/program index 1830a60..3f92406 100755 Binary files a/cv2/program and b/cv2/program differ diff --git a/cv2/program.c b/cv2/program.c index 8cb81ff..1481b31 100644 --- a/cv2/program.c +++ b/cv2/program.c @@ -43,25 +43,30 @@ int main() { helper++; } - counter2 = (counter2 / 2) - 1; + counter2 = (counter2 / 2); qsort(databaza, counter2,sizeof(struct jedlo),compare); - while(counter2 >= 0){ - printf("%s", databaza[counter2].name); - printf("%f\n", databaza[counter2].price); - counter2--; + for(int z=0; zprice == s2->price){ - return 0; + int order; + + if(s1.price > s2.price){ + order = 1; } - else if(s1->price < s2->price){ - return 1; + else if(s1.price < s2.price){ + order = -1; } - return -1; + else { + order = 0; + } + return order; } \ No newline at end of file