using namespace std;
void fun(int &a,int &b)
{
int p; p=a; a=b; b=p;
}
void exchang(int &a, int &b, int &c)
{
if(a< b) fun(a,b);
if(a< c) fun(a,c);
if(b< c) fun(b,c);
}
int main()
{
int a,b,c;
a= 112; b=48; c=66;
exchang(a,b,c);
cout<<"a="<< a<<"b="<<b<<"c="<< c<< endl;
}
输出:

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

