#include <iostream.h>
void false_swap(int& a,int& b)
{
a=a-b;
b=a+b;
a=b-a;
}
int main()
{
int x=3;
int y=4;
false_swap(x,y);
cout<<x<<" "<<y<<endl;
return 0;
}
和
#include <iostream.h>
void false_swap(int a,int b)
{
a=a-b;
b=a+b;
a=b-a;
}
int main()
{
int x=3;
int y=4;
false_swap(x,y);
cout<<x<<" "<<y<<endl;
return 0;
}