关闭

c++基础:学生成绩

56人阅读 评论(0) 收藏 举报



#include <iostream>



using namespace std;


class student
{
public:
    student (double S,int X,char SEX);
    ~student();
void chengji(double chinese,double math,double english);


private:
    double score;
    int xuehao;
    char sex;


};


student::student(double S,int X,char SEX)
{
    score = S;
    xuehao = X;
    sex=SEX;
}


student::~student()
{


    cout<<"xueshengchengji"<<endl;
    cout<<score<<xuehao<<sex<<endl;
}
void student::chengji(double chinese,double math,double english)
{
    cin>>chinese>>math>>english>>endl;
}
int main ()
{


    student A(0,101,m);
    A.chengji(0,0,0);
    return 0;


}
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:8905次
    • 积分:487
    • 等级:
    • 排名:千里之外
    • 原创:42篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条