如何自定义swap函数
#include <stdio.h>int main()
{
void swap(int *px, int *py)
{
int temp, x, y;
printf("请输入x,y\n");
scanf("%d, %d\n",&x, &y);
px = &x;
py = &y;
temp = *px;
*px = *py;
*py = temp;
printf("交换后x=%d, y=%d",x, y);
}
return 0;
}
如何改
[此贴子已经被作者于2017-10-30 22:32编辑过]