作业4.18
来源:互联网 发布:800002711零点网络 编辑:程序博客网 时间:2024/05/16 23:44
#include <iostream>using namespace std;class Student{public:Student();void get_stu();void max(Student *s);private:int number;int score;};Student::Student(){}void Student::get_stu(){cin>>number>>score;}void Student::max(Student *s){int i;int maxsco=0;int maxnum=0;for(i=0;i<6;++i){if ((s+i)->score>maxsco){maxsco=(s+i)->score;maxnum=(s+i)->number;}}cout<<"成绩最高者的学号是:"<<maxnum<<endl;}int main(){int i;Student s[6];Student *p=s;for(i=0;i<6;i++){cout<<"请输入第"<<i+1<<"名学生的学号和成绩"<<endl;p[i].get_stu();}p->max(p);return 0;}
0 0
- 作业4.18
- 作业4.18
- 作业4.18
- 作业4.18
- 作业4.18
- 作业4.17 4.18
- c++作业4.18
- C++作业4.18
- 第四章作业4.18
- 小白4.18作业
- 作业
- 作业
- 作业
- 作业
- 作业
- 作业
- 作业
- 作业
- HttpClient使用详解
- 新Hibernate SessionFactory().getCurrentSession()猫腻
- Redis的Java客户端Jedis的八种调用方式(事务、管道、分布式)介绍
- Java继承关系构造函数的调用
- java中hashcode()函数的作用
- 作业4.18
- 进程地址空间映射
- 开启gd2的方法
- Time Zone
- View的点击效果-水波纹
- 渗透测试元数据搜集之Metagoofil
- 导入hadoop源码到eclipse
- spring之jdbc配置到固定路径
- FreeMarker生成word的代码