这个要记住函数体内的形式参数得是指针变量,实参为变量地址,在函数体内,得用数据变量来进行交换,因为我们是利用地址储存的数据变量值来交换。 #include <stdio.h> // write your code here...... void swap(int *p,int *q){ int temp; temp=*q; *q=*p; *p=temp; } int main() { int m, n; scanf("%d",&m); scanf("%d",&n); // write your code here...... ...