没注释的源代码
#include <iostream>
using namespace std;
void swap(int *p1,int *p2);
int main()
{
int a,b,c,*p1,*p2,*p3;
cout<<"please input int a,b,c:";
cin>>a>>b>>c;
p1=&a;
p2=&b;
p3=&c;
if(a>b) swap(p1,p2);
if(a>c) swap(p1,p3);
if(b>c) swap(p2,p3);
cout<<"now the order is:"<<a<<" "<<b<<" "<<c<<endl;
return 0;
}
void swap(int *p1,int *p2)
{
int temp;
temp=*p1;
*p1=*p2;
*p2=temp;
}