结构体数组例题1

结构体数组例题1

学生成绩表xscj

#include
using namespace std;
int main()
{
    struct xscj
    {
        char xh[100];
        float cj[2];
        float av;
    };
    struct xscj xs[4]={{"01",70,80},{"02",78,67},{"03",56,78},{"04",90,80}};
    int i;
    for(i=0;i<4;i++)
    {
        xs[i].av=(xs[i].cj[0]+xs[i].cj[1])/2.0;
        cout<

你可能感兴趣的:(结构体数组例题1)