题目:
输入 10 个整数,将其中最小的数与第一个数对换,把最大的数与最
后一个数对换。
源代码:
//课程:C++实验 3
//题目:输入 10 个数,最小数与第一个交换,最大数与最后一个交换
//语言:C++
//作者:武叶
//创作时间:2012 年 3 月 20 日
#include
#include
#include
#include
using namespace std;
void input(int *p1)
{
cout<<"请输入 10 个整数:"<>*(p1+i);
cout<*max)
max=p;
//max 存入最大数的内存地址
temp=number[9];
number[9]=*max;
*max=temp;
for (p=number+1;p
运行结果截图:
答销网真情提供:::::www.daxiao51.com
【C++】输入 10 个整数,将其中最小的数与第一个数对换【原创技术】
http://www.daxiao51.com/forum.php?mod=viewthread&tid=1558&fromuid=1