Vad är det för priser då?
Hur löste ni andra problemet?
jag gjorde så här:
int pengar1, pengar2;
int x, y, z;
x = y = z = 0;
for(x = 10; x >= 0; x--){
pengar1 = 100-10*x;
for(y = pengar1/3; y >= 0; y--){
pengar2 = pengar1-3*y;
for(z = pengar2*2; z >= 0; z--){
if((x + y + z == 100) && ((float)(10*x+3*y+0.5*z) == 100.0f))
printf("%d kossor\t %d får\t %d höns\t %0.2fkr\n", x, y, z, (float)(10*x+3*y+0.5*z));
}
}
}