第四章实验4
来源:互联网 发布:逻辑 知乎 编辑:程序博客网 时间:2024/05/20 13:18
#include<iostream> using namespace std; class Student { public: float score; static float total_score; static double count; void account(float s) { score=s; ++count; total_score+=score; }; static float sum() { return total_score; };static float average() { return(total_score/count);};float Student::total_score=0.0; double Student::count=0;int main(){Student stu[4]; stu[1].account (80);stu[2].account (90); stu[3].account (69); stu[4].account (82); cout<<"学生总成绩:"<<Student::sum()<<endl; cout<<"学生平均成绩:"<<Student::average()<<endl; return 0;}
0 0
- 第四章实验4
- 第四章实验3.实验4
- 第四章实验第四题
- C++作业第四章实验4
- 第四章:实验任务
- 第四章实验作业
- 第四章实验作业
- 第四章实验3
- 第四章 实验三
- 第四章实验第三题
- C++第四章实验3
- 数据结构第四章上机实验
- WinCE 编程实验(第四章 储存管理)
- kali Linux 第四章 实验环境
- 第四次上机实验
- 第四次上机实验
- 第四次上机实验
- 第四次实验报告
- Android ListView异步加载图片错位问题解析
- 基于Spring框架的Shiro配置
- 第四章实验3
- 如何查看openCV源代码
- freemarker常见语法大全
- 第四章实验4
- Java同步技术(二)
- Error inflating class 的问题
- HDU 2017
- 前端学习
- jquery选择器
- MAC 在 Android 开发者官网里下载的 ADT 运行不了 Java project
- 谷歌地图的引用
- Linux高级编程 第七章 信号 sigqueue sigaction 管道 匿名管道