4.21
来源:互联网 发布:淘宝网男士运动裤 编辑:程序博客网 时间:2024/06/06 08:43
#include <iostream>#include <string>using namespace std;class student{private:float num;string name;float score;static int count;static float sum;float ave;public:student(float num1,string name1,float score1);static void show(student &stu);static void show_all(student &Stu);};void student::show(student &stu0){cout<<"学号"<<stu0.num<<endl;cout<<"姓名"<<stu0.name<<endl;cout<<"成绩"<<stu0.score<<endl;}void student::show_all(student &Stu){ cout<<"总成绩"<<sum<<endl;cout<<"总人数"<<count<<endl;cout<<"平均成绩"<<Stu.ave<<endl;}student::student(float num1,string name1,float score1){num=num1;name=name1;score=score1;sum=sum+score;count=count+1;ave=sum/count;}int student::count=0;float student::sum=0.0;int main(){student stu[3]={ student(1,"zhang",96),student(2,"si",89),student(3,"xin",69)}; student::show(stu[0]);student::show(stu[1]);student::show(stu[2]); stu[2].show_all(stu[2]);return 0;}
0 0
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 【4.21】
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21
- 4.21 牢骚
- 4.21 周一
- 这些年被我们玩坏的Xcode -- Xcode debug area 的 debugger command 使用
- 设计模式:4)生成器模式
- vitrualbox 4 虚拟Ubuntu共享 主机文件夹方法
- 转载]ThinkPHP的多表查询
- VC++如何处理自定义消息
- 4.21
- 使用texlive写硕士论文
- IDT 中断描述符表
- 第3题
- (转)【Unity技巧】Unity中的优化技术
- nyoj-1052 看美女(二)
- 在Android中进程按优先级
- CURD方法盘点:table方法
- linux下安装beego(linux(centos/ubuntu) install beego)