#include <stdio.h>
#include <math.h>
struct Body{
int id;
double height;
double weight;
double bmi;
};
int main(void){
struct Body data[]={{1,170,60},{2,150,50},{3,160,56},{4,180,70}};
for(int i=0;i<4;i++){
data[i].bmi=data[i].weight/((data[i].height/100)*(data[i].height/100));
printf("id:%d,BMI:%lf\n",data
[i
].
id,data
[i
].
bmi); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgpzdHJ1Y3QgQm9keXsKCWludCBpZDsKCWRvdWJsZSBoZWlnaHQ7Cglkb3VibGUgd2VpZ2h0OwoJZG91YmxlIGJtaTsKfTsKCmludCBtYWluKHZvaWQpewoJc3RydWN0IEJvZHkgZGF0YVtdPXt7MSwxNzAsNjB9LHsyLDE1MCw1MH0sezMsMTYwLDU2fSx7NCwxODAsNzB9fTsKCWZvcihpbnQgaT0wO2k8NDtpKyspewoJCWRhdGFbaV0uYm1pPWRhdGFbaV0ud2VpZ2h0LygoZGF0YVtpXS5oZWlnaHQvMTAwKSooZGF0YVtpXS5oZWlnaHQvMTAwKSk7CgkJcHJpbnRmKCJpZDolZCxCTUk6JWxmXG4iLGRhdGFbaV0uaWQsZGF0YVtpXS5ibWkpOwoJfQoJcmV0dXJuIDA7Cn0K