题解 | #编写函数实现两数交换(指针方式)#
编写函数实现两数交换(指针方式)
https://www.nowcoder.com/practice/380c764bdef64ad696cdfa90bfe85156
#include <stdio.h>
void swap(int * i,int * j)
{
int tmp=0;
tmp=*i;
*i=*j;
*j=tmp;
}
int main()
{
int i,j=0;
scanf("%d %d",&i,&j);
swap(&i,&j);
printf("%d %d",i,j);
return 0;
}

