关于爱立信笔试的那题..麻烦高手进来看看我哪错了
不用 if else ?: 等,求三个数的中间值
#include "stdio.h "
void getmid(int * A,int * B,int * C);
main()
{
int x = 123,y = 456,z = 33;
getmid(&x,&y,&z);
return 0;
}
void getmid(int * A,int * B ,int * C)
{
int temp;
while(*A < *B)
temp = *A;
*A = *B;
*B = temp;
do
{
printf( "%d ",*A);
break;
}
while (*A < *C);
}
在自学C语言...看到指针这里感觉很头疼 TT
能通过编译 但是编出来什么都没显示
不知道哪里错了 能帮我检查下吗
[解决办法]
while(*A < *B)
{
temp = *A;
*A = *B;
*B = temp;
}