> 其他 >
有三个数abc,要求按大小顺序输出.请问用C语言怎么写?
人气:240 ℃ 时间:2020-01-31 02:55:04
解答
void sort(int* a,int* b,int* c)
{
int t;
if (*a>*b)
t=*a,*a=*b,*b=t;
if (*b>*c)
{
t=*b,*b=*c,*c=t;
if (*a>*b)
t=*a,*a=*b,*b=t;
}
}
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版