设计一个学生类CStudent,包括姓名和三门课程成绩,利用重载运算符“+”将所有学生C++

[复制链接]
查看11 | 回复3 | 2021-9-30 15:13:09 | 显示全部楼层 |阅读模式
如下:#include #include #include[I]using namespace std;class student{private:char a[20];
//不能在类定义中对非static const型变量赋值int x ,y ,z;int cnt;
//计数器,存放成绩对应的人数。默认为1个学生的成绩。public :student():cnt(1){a[0]='\0';x=y=z=0;}st...
回复

使用道具 举报

千问 | 2021-9-30 15:13:09 | 显示全部楼层
#include #include #include[I]using namespace std;class student{private:char a[20];
//不能在类定义中对非static const型变量赋值int x ,y ,z;int cnt;
//计数器,存放成绩对应...
回复

使用道具 举报

千问 | 2021-9-30 15:13:09 | 显示全部楼层
#include using namespace std;class student{public :char a[20];int x ,y ,z;student(){}student (char b[20],int m,int k,int t){ for(int i=0;i<20;i++) { a=b[...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行