作业4.21
来源:互联网 发布:linux listen 端口 编辑:程序博客网 时间:2024/05/29 19:00
#include<iostream>#include<string>using namespace std;class student{public:student(string name1,string num1,int score1);void show();static void show_count_sum_ave();private:string name;int score;static int count;static float sum;static float ave;string num;};student::student(string name1,string num1,int score1){name=name1;score=score1;num=num1;++count;sum=sum+score;ave=sum/count;}void student::show(){cout<<"姓名:"<<name<<endl <<"成绩:"<<score<<endl <<"学号:"<<num<<endl;}void student::show_count_sum_ave(){cout<<"学生人数:"<<count<<endl<<"学生总成绩:"<<sum<<endl<<"平均成绩:"<<ave<<endl;}int student::count=0;float student::ave=0.0;float student::sum=0.0;int main(){student stu1("xiaoming","111111",75);stu1.show(); student stu2("xiaohong","111112",76); stu2.show(); stu2.show_count_sum_ave(); return 0;}
0 0
- 作业4.21
- 作业4.21
- 作业4.21
- 作业4.21
- 作业4.21
- 作业4.21
- 作业4.21
- 作业4.21~4.22
- 第四章作业4.21
- C++作业4.21
- C++作业4.21
- 第四章作业4.21
- 第四章作业4.21
- 作业
- 作业
- 作业
- 作业
- 作业
- 常用的官方文档或者软件路径
- 2014-2015读书清单
- Android SDK开发包国内下载地址
- android应用签名
- GitHub 优秀的 Android 开源项目
- 作业4.21
- Android 开发实例教程 零基础学习 1小时入门 图解说明教程 化复杂为简单 配置好的android开发环境 带实例
- seo到底该做什么?
- STM32串口IAP(YModem) (转载)
- gSoap介绍
- Android照片墙加强版,使用ViewPager实现画廊效果
- 第3题
- 数据挖掘之聚类k-means
- OpenVswitch & 协议报文上CPU方法