个人作业
来源:互联网 发布:69圣战 知乎 编辑:程序博客网 时间:2024/06/01 09:04
头文件
#include<iostream>
using namespace std;
class Array_max
{
public:
void set_value();
void max_value();
void show_value();
private:
int array[10];
int max;
};
源代码#include<iostream>
#include<stdlib.h>
#include"arraymax.h"
using namespace std;
void Array_max::show_value()
{
cout<<"max="<<max;
}
void Array_max::set_value()
{
int i;
for(i=0;i<10;i++)
cin>>array[i];
}
void Array_max::max_value()
{
int i;
max=array[0];
for(i=1;i<10;i++)
if(array[i]>max) max=array[i];
}
int main()
{
Array_max arrmax;
arrmax.set_value();
arrmax.max_value();
arrmax.show_value();
system("pause");
return 0;
}
0 0
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- MyBatis学习总结(二)——使用MyBatis对表执行CRUD操作
- mysql递归查询树形表
- 使用Nexus搭建Maven代理仓库
- MyBatis学习总结(三)——优化MyBatis配置文件中的配置
- Linux下objdump使用方法
- 个人作业
- Java中Vector集合的总结
- 分布式java应用
- unity 无缝大地图
- 精确到小数n位
- bootstrap-switches-button
- iOS 开发:用 Instruments 来检验你的app
- IOS 自定义cell 分割线不完整
- C/C++学习笔记(三)