#include<bits/stdc++.h>
using namespace std;
int main()
{ void triswap(int*,int*,int*);
int *num_1,*num_2,*num_3,a,b,c;
cin>>a>>b>>c;
num_1=&a;
num_2=&b;
num_3=&c;
triswap(num_1,num_2,num_3);
cout<<a<<" "<<b<<' '<<c<<'\n';
}
void triswap(int *p1,int *p2,int *p3)
{
void myswap(int *,int *);
if(*p1<*p2)myswap(p1,p2);
if(*p1<*p3)myswap(p1,p3);
if(*p2<*p3)myswap(p2,p3);
}
void myswap(int *pp1,int *pp2)
{
int t;
t=*pp1;
*pp1=*pp2;
*pp2=t;
}
输入三个数输出最大(用指针)
最新推荐文章于 2024-05-19 14:34:14 发布