#include<stdio.h>
#define N 10
int main(){
float h[N],w[N],e,t;
int i;
for(i=0; i<N; i++){
printf("输入第%d个人的身高(cm)和体重(kg):",i+1);
scanf("%f%f",&h[i],&w[i]);
}
for(i=0; i<N; i++){
t=h[i]/100;
e=w[i]/(t*t);
if(e<18) printf("身高:%6.2fcm,体重:%6.2kgf——偏瘦\n", h[i],w[i]);
else if(e<25) printf("身高:%6.2fcm,体重:%6.2fkg——正常体重\n",h[i],w[i]);
else if(e<30) printf("身高:%6.2fcm,体重:%6.2fkg——微度肥胖\n",h[i],w[i]);
else if(e<35) printf("身高:%6.2fcm,体重:%6.2fkg——轻度肥胖\n",h[i],w[i]);
else printf("身高:%6.2fcm,体重:%6.2fkg——重度肥胖\n",h[i],w[i]);
}
}
追问谢谢了哈