作业4.17 4.18
来源:互联网 发布:淘宝水洗主板 编辑:程序博客网 时间:2024/05/26 05:52
#include<iostream> using namespace std; class Student { public: Student(int n,int s) { no=n; score=s; } static void show(Student q) { cout<<q.no<<" "<<q.score<<endl; } private: int no; int score; }; int main() { Student stu[6]= { Student(1,100), Student(2,99), Student(3,98), Student(4,97), Student(5,96), Student(6,95) }; for(int i=1;i<6;i+=2) { Student::show(stu[i]); } return 0; }
<pre name="code" class="cpp">#include<iostream>using namespace std;class Student{public:Student(int n,int s){no=n;score=s;}void show(Student q) { cout<<q.no<<" "<<q.score<<endl; } static void max(Student *p) { int big=p[0].score ;int x; for(int i=0;i<6;i++) if(big<=p[i].score) {big=p[i].score ,x=i;} cout<<"六位同学中成绩最高的是:"<<p[x].no<<endl; cout<<big<<endl; }private:int no;int score;};int main(){Student stu[6]={Student(1,100),Student(2,99),Student(3,98),Student(4,97),Student(5,96),Student(6,95)};Student::max(stu) ; return 0; }
0 0
- 作业4.17 4.18
- 作业4.17
- 作业4.17
- 作业4.17
- 作业 4.17
- 作业4.17
- 作业4.17
- 4.17【作业】
- 作业4.18
- 作业4.18
- 作业4.18
- 作业4.18
- 作业4.18
- C++作业4.17与4.18合成版
- 作业4.17~4.20
- 第四章作业4.17
- C++作业4.17
- C++作业4.17
- Jenkins不同job之间传递参数
- android中最好的瀑布流控件PinterestLikeAdapterView
- The Implementation of RFCOMM in Android
- 彻底释放Linux线程的资源
- SVN 中trunk、tags、branches使用
- 作业4.17 4.18
- 最新版SDWebImage的使用
- 采集音频和摄像头视频并实时H264编码及AAC编码
- 赛迪预测2015年中国IT产业发展十大趋势
- DFS(深度优先遍历)和 BFS(广度优先遍历)
- 如何借助lynis扫描Linux的安全漏洞?
- RGB颜色转换十六进制颜色
- Launcher3 源码分析(二)屏幕适配
- 理解 Thread.Sleep 函数 ,Sleep(0) 释放当前线程所剩余的时间片,让线程马上回到就绪队列而非等待队列