#include <stdio.h>
struct body{
double 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++){
printf("id:%lf\n",data
[i
].
id); printf("height:%lf\n",data
[i
].
height); printf("weight:%lf\n",data
[i
].
weight); printf("bmi:%lf\n",data
[i
].
weight/((data
[i
].
height/100)*(data
[i
].
height/100))); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgYm9keXsKCWRvdWJsZSBpZDsKCWRvdWJsZSBoZWlnaHQ7Cglkb3VibGUgd2VpZ2h0OwoJZG91YmxlIGJtaTsKfTsKaW50IG1haW4odm9pZCkgewoJCglzdHJ1Y3QgYm9keSBkYXRhW109ewoJCSB7MSwxNzAsNjB9LAoJCSB7MiwxNTAsNTB9LAoJCSB7MywxNjAsNTZ9LAoJCSB7NCwxODAsNzB9LAoJfTsKCWZvcihpbnQgaT0wO2k8NDtpKyspewoJCXByaW50ZigiaWQ6JWxmXG4iLGRhdGFbaV0uaWQpOwoJCQlwcmludGYoImhlaWdodDolbGZcbiIsZGF0YVtpXS5oZWlnaHQpOwoJCQkJcHJpbnRmKCJ3ZWlnaHQ6JWxmXG4iLGRhdGFbaV0ud2VpZ2h0KTsKCQkJCQlwcmludGYoImJtaTolbGZcbiIsZGF0YVtpXS53ZWlnaHQvKChkYXRhW2ldLmhlaWdodC8xMDApKihkYXRhW2ldLmhlaWdodC8xMDApKSk7Cgl9CglyZXR1cm4gMDsKfQo=