作業二 作業二

 #include <stdio.h>

#include <stdlib.h>
 
 main()
 {
  
  struct student
  
  {
   int id;
   float height;
   int weight;
   float bmi;
  };
  
 struct student a, b, c, d;
 
 a.height=1.7;
 a.weight=60;
 
 b.height=1.75;
 b.weight=60;
 
 c.height=1.8;
 c.weight=60;
 
 d.height=1.9;
 d.weight=60;
 
 a.bmi= a.weight/(a.height*a.height);
 b.bmi= b.weight/(b.height*b.height);
 c.bmi= c.weight/(c.height*c.height);
 d.bmi= d.weight/(d.height*d.height);
 
 printf("%5.2f\n",(a.bmi+b.bmi+c.bmi+d.bmi)/4);
 system("pause");
    
 }