求助>。<帮忙解决这个问题
要怎么用男兔子的号码替代匹配度输出呢?
程序代码:
#include<stdio.h> #include<math.h> int main(){ int i,h,w,age,boyh,boyw,boyage,girlh,girlw,girlage; float love,min=0.0; h=boyh-girlh; w=boyw-girlw; age=boyage-girlage; printf("请输入女兔子数据:"); scanf("%d%d%d",&girlh,&girlw,&girlage); i=1; while(i<5){ if(girlh<10&&girlw<5&&girlage<1) break; if(girlh>30&&girlw>20&&girlage>10) break; else{ printf("请输入男兔子数据:"); scanf("%d%d%d",&boyh,&boyw,&boyage); love=fabs(h-5)+1/2*(fabs(w-10))+2*(fabs(age-2)); printf("%.2f\n",love); i++; } } for(i=1;i<5;i++){ if(min>love) min=love; else continue; } printf("匹配度为%.2f的男兔子是优先入选者!",min); return 0; }