就是你在fun里修改了ab,但是c[i]和c[i+1]并没有调换。 如果要调换,可以用 void fun(int *a, int * b) { int t = *a; *a = *b; *b = t; }