C语言指针实现整数交换 - 代码示例及解析
#include <stdio.h>
void Swap(int *x, int *y);
int main() { int a, b; scanf('%d %d', &a, &b); Swap(&a, &b); printf('%d %d', a, b); return 0; }
void Swap(int *x, int *y) { int temp = *x; *x = *y; *y = temp; }
原文地址: https://www.cveoy.top/t/topic/ocWB 著作权归作者所有。请勿转载和采集!