![]() |
#2
stop12042014-11-13 07:40
|
#include <iostream>
using namespace std;
int main()
{
void swap(int *q1,int *q2);
int a,b,c,*p1,*p2,*p3;
p1=&a;
p2=&b;
p3=&c;
cin>>a>>b>>c;
cout<<endl;
if(a<b)swap(p1,p2);
if(b<c)swap(p2,p3);
if(a<b)swap(p1,p2);
cout<<a<<" "<<b<<" "<<c<<" "<<endl;
return 0;
}
void swap(int *q1,int *q2)
{
int t;
t=*q1;
*q1=*q2;
*q2=t;
}
举个例子 5 4 6输出6 5 4 然后我不想让它就这么结束,我想还可以输入几组 进行判断,,这样应该怎么搞啊?