指针这样exchenge
#include <iostream>
using namespace std;
int main()
{int a,b;
int *p1,*p2,*p;
cin>>a>>b;
p1=&a;
p2=&b;
if(*p1<*p2)
{p=p1;
p1=p2;
p2=p;
}
cout<<endl;
cout<<*p1<<" "<<*p2<<endl;
return 0;
using namespace std;
int main()
{int a,b;
int *p1,*p2,*p;
cin>>a>>b;
p1=&a;
p2=&b;
if(*p1<*p2)
{p=p1;
p1=p2;
p2=p;
}
cout<<endl;
cout<<*p1<<" "<<*p2<<endl;
return 0;