第三章习题T4
来源:互联网 发布:网络电影 编辑:程序博客网 时间:2024/05/05 18:31
#include <iostream>
using namespace std;
class Student
{public:
Student(int n,float s):num(n),score(s){}
void display();
private:
int num;
float score;
};
void Student::display()
{cout<<num<<" "<<score<<endl;}
int main()
{Student stud[5]={
Student(101,78.5),Student(102,85.5),Student(103,98.5),
Student(104,100.0),Student(105,95.5)};
Student *p=stud;
for(int i=0;i<=2;p=p+2,i++)
p->display();
return 0;
}
0 0
- 第三章习题T4
- 第三章习题
- C++习题第三章
- 第三章习题汇总
- 第三章习题 T2
- 第三章习题T3
- 第三章习题T5
- 第三章习题T6
- 第三章习题
- 第三章习题
- 第三章习题
- 第三章习题5.3
- 【第三周】第三章习题3.7
- 【第三周】第三章习题3.5
- 【第三周】第三章习题3.6
- 编程珠玑第三章习题
- opencv第三章习题2
- opencv第三章习题参考
- 黑马程序员:多态和内部类
- 第七题
- sicily 1021 couples
- JS中setTimeout()的用法详解
- P153 2
- 第三章习题T4
- 隐性改变display类型
- c++多线程实验代码
- Java 三大框架 SSH
- Elyar的实用工具类(一)
- 序列中只有一个数出现了一次,其他均出现了两次,找出只出现过一次的这个数
- UVA 矩阵链乘
- list_head结构体
- P153 3