学生成绩及格与不及格

来源:互联网 发布:淘宝模块信息怎么写 编辑:程序博客网 时间:2024/04/28 20:48
//02.* Copyright (c) 2013, 烟台大学计算机学院   //04.* 作    者: 马德鹏   //05.* 完成日期:2014 年 6 月 29 日   //06.* 版 本 号:v1.0   //07.* #include <iostream>using namespace std;struct Student{    public:    void set();    void show();    private:    double num;    int Chinese;    int Math;    int English;    int save;}stu;void Student::set(){    cin>>stu.num>>stu.Chinese>>stu.Math>>stu.English;      stu.save=(stu.Chinese+stu.Math+stu.English)/3;    cout<<"student:"<<stu.num<<endl;    cout<<stu.save<<endl;}void Student::show(){    if(stu.Chinese>=60&&stu.Math>=60&&stu.English>=60)    {        cout<<"pass";    }     if(stu.Chinese<60)    {        cout<<"Chinese"<<endl;    }    if(stu.Math<60)    {        cout<<"Math"<<endl;    }    if(stu.English<60)    {        cout<<"English"<<endl;    }}int main(){  stu.set();  stu.show();    return 0;}

0 0