</pre>非常简单,没什么好说的<pre name="code" class="cpp">#include <stdio.h>
void ascending_sort(int x,int y,int z);
int main(void)
{
int x,y,z;
scanf("%d %d %d",&x,&y,&z);
ascending_sort(x,y,z);
return 0;
}
void ascending_sort(int x,int y,int z)
{
int temp;
if( x>y )
{
temp = x;
x = y;
y =temp;
}
if( x>z )
{
temp = x;
x = z;
z =temp;
}
if( y>z )
{
temp = y;
y = z;
z =temp;
}
printf("%d %d %d\n",x,y,z);
}
数据结构(C语言版)课后习题1.4
最新推荐文章于 2021-05-20 07:20:37 发布