#include
#include
Using namespace std;
Class Chenji
{
Public:
Chenji();
Void intput{cin>>num>>name>>eng>>math>>c;}
Void Chenji_tongji();
int Chenji_paiming();
Void Chengji_output();
Void eng();
Void math();
Void cjia();
Static double zong[3];
Static double engdengji[5];
Static double mathdengji[5];
Static double cdengji[5];
Static double chenjicunchu[100];
Static int renshu;
Double zong;
Double zongscore;
Double gerenzongscore;
Double num;
Double name;
Double eng;
Double math;
Double cjia;
};
Static Chenji::zong[3]={0};
Static Chenji::engdengji[5]={0};
Static Chenji::mathdengji[5]={0};
Static Chenji::cjiadengji[5]={0};
Void Chenji::Chenji_tongji()
{zong+=eng; zong+=math; zong+=cjia;ping=zong/3;
zong[0]+=eng; zong[1]+=math; zong[2]+=cjia; //3科各科总分;
eng();math();cjia();i++;
}
Void Chenji::eng() //英语各等级人数
{
if(eng>90) engdengji[0]++;
else if(eng>80) engdengji[1]++;
else if(eng>70) engdengji[2]++;
else if(eng>60) engdengji[3]++;
else engdengji[4]++;
}
Void Chenji::math() //数学各等级人数
{
if(math >90) mathdengji[0]++;
else if(math>80) mathdengji[1]++;
else if(math >70) mathdengji[2]++;
else if(math >60) mathdengji[3]++;
else mathdengji[4]++;
}
Void Chenji::cjia() //c++各等级人数
{
if(cjia >90) cjia dengji[0]++;
else if(cjia >80) cjia dengji[1]++;
else if(cjia >70) cjia dengji[2]++;
else if(cjia >60) cjia dengji[3]++;
else cjia dengji[4]++;
}
int Chenji::Chengji_paiming()
{chengjicunchu[--Chenji::i]=zong;
}
//自己写个排序的函数Chenji_paimingx();,像冒泡,在要输出信息时候用for调用,传各学生对象给它;
//用zong等于chengjicunchu[i],用个变量存i,返回该变量(即排名);
Void Chenji::Chengji_output()
{cout<<”学号”<}
Int main()
{
//定义学生对象
//用for调用对象intput();和chengji_tongji();和chengji_paiming;
//用for调用对象的output();和chengji_paimingx();
Cout<<”所有学生的英语,数学,c++平均成绩为:” <}
--------------------next---------------------
阅读(1230) | 评论(0) | 转发(0) |