#include <iostream.h>
void swap(int &e,int &f)
{
int temp;
temp=e;
e=f;
f=temp;
}
void intSort(int &a, int &b, int &c)
{
int temp;
if (a<b)
{
swap(a,b);
}
if (a<c)
{
swap(a,c);
}
if (b<c)
{
swap(b,c);
}
}
int main()
{
int a=4,b=13,c=12;
intSort(a,b,c);
cout <<a<<","<<b<<","<<c<<endl;
return 0;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载