#include <stdio.h>
#include <stdlib.h>
int yy = 2;
void swap(int xx, int *yy);
main(void){
int xx = 3;int tmp ;
tmp = xx;
xx = yy;
latest #8
yy = tmp;
printf("\n xx = %d ", xx );
// xx = _____
printf("\n yy = %d ", yy );
// yy = _____
xx = tmp + yy;
swap( xx, &yy );
printf("\n yy = %d ", yy );
// yy = _____
system("pause");
}
void swap(int xx, int *yy) {
int tmp ;tmp = xx;
xx = *yy;
*yy = tmp;
printf("\n xx = %d ", xx );
// xx = _____
printf("\n *yy = %d ", *yy );
// *yy = _____
}
他這邊已經宣告int xx = 3; int tmp ;所以xx=3=tmp 然後 xx = yy; 所以yy=3 應該是這樣吧xD
back to top