作者在 2009-10-16 09:44:37 发布以下内容
include<stdio.h>
Swap(int &x,int *y)
{
int c;
c=x,x=*y,*y=c;
return 0;
}
main ()
{
int a,b;
scanf("%d%d",&a,&b);
printf("the first value:a=%d,b=%d\n",a,b);
Swap(a,&b);
printf("after swap value:a=%d,b=%d\n",a,b);
return 0;
}
{
int c;
c=x,x=*y,*y=c;
return 0;
}
main ()
{
int a,b;
scanf("%d%d",&a,&b);
printf("the first value:a=%d,b=%d\n",a,b);
Swap(a,&b);
printf("after swap value:a=%d,b=%d\n",a,b);
return 0;
}