#include <stdio.h> /三个数排序< </
void swap(int *pa,int *pb)
{
int temp;
temp = *pa;
*pa = *pb;
*pb = temp;
}
void main()
{
int a,b,c,temp;
scanf("%d%d%d",&a,&b,&c);
if(a>b)
swap(&a,&b);
if(b>c)
swap(&b,&c);
if(a>c)
swap(&a,&c);
printf("%d,%d,%d",a,b,c);
}
#include <stdio.h>/输入n个数 按输入的逆序排列/
void reverse(int a[],int n)
{ int *p;
for(p=a+n-1;p>=a;p--)
printf("%4d",*p);
printf("\n");
}
main()
{ int a[20],n;
int i;
printf("Input the length of array:");
scanf("%d",&n);
printf("Input the number of array:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
reverse(a,n);
}