题解 | #编写函数实现两数交换(指针方式)#
编写函数实现两数交换(指针方式)
https://www.nowcoder.com/practice/380c764bdef64ad696cdfa90bfe85156
#include<stdio.h> int main() { int n, m, temp; scanf("%d %d", &m, &n); int* p1 = &n, *p2 = &m;//初始化两个int类型指针 temp = *p1; *p1 = *p2; *p2 = temp; printf("%d %d\n", m, n); return 0; }#C#
0基础学C 文章被收录于专栏
0基础学C,从算法开始