使用函数实现两个数的交换。

错误代码以下:运行结束后a,b的值并无像我预想的那样发生交换!web #include<stdio.h> #include<stdlib.h> void swap(int x, int y){ int tmp = 0; tmp = x; y = x; y = tmp; } int main(){ int a = 1; int b = 2; swap(x, y); printf("x
相关文章
相关标签/搜索