6.4 a,b,c 3ɴС˳
ܵķ3ָָ3ͱȻswapʵֻ3ͱֵ
£ 
#include <iostream>
using namespace std;
int main( )
{ void exchange(int *,int *,int *);    //exchange
int a,b,c,*p1,*p2,*p3;
cin>>a>>b>>c;                        //3
p1=&a;p2=&b;p3=&c;                   //ָ3ͱ
exchange(p1,p2,p3);                  //p1,p2,p3ָ3ͱֵ
cout<<a<< <<b<< <<c<<endl;       //ɴС˳3
}

void exchange(int *q1,int *q2,int *q3)
{void swap(int *,int *);              //swap
if(*q1<*q2) swap(q1,q2);             //swap,q1q2ָıֵ
if(*q1<*q3) swap(q1,q3);             //swap,q1q3ָıֵ
if(*q2<*q3) swap(q2,q3);             //swap,q2q3ָıֵ
}

void swap(int *pt1,int *pt2)           //pt1pt2ָıֵ
{int temp;
temp=*pt1;
*pt1=*pt2;
*pt2=temp;
}