69,382
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<stdlib.h>
#define N 10
main()
{
int a[N],*u,*p,n=0,*q,*m,i;
int t;
int l;
system("cls");
printf("Please input number:");
for(i=0;i<=9;i++)
scanf("%d",&a[i]);
q=p=m=u=a;
for(p=a+1;p<a+10;p++)
{
if(*p>*m)
m=p;
if(*p<*u)
u=p;
}
t=*m;
*m=*a;
*m=t;
q=a+9;
l=*u;
*u=*q;
*q=l;
for(p=a;p<a+10;p++)
printf("%4d",*p);
getch();
}