#include<iostream>
using namespace std;

void swap(int &x,int &y)//利用中间变量
{
      int tmp;
      tmp=x;
      x=y;
      y=tmp;
}

void swap2(int &x,int &y)//不用中间变量
{
       x=x^y;
       y=x^y;
       x=x^y;
}

void swap3(int &x,int &y)//不用中间变量
{
       x=x+y;//利用总和
       y=x-y;//求y
       x=x-y;//用已知y求x
}

int main()
{
      int a=3,b=7;
      swap3(a,b);
      cout<<a<<','<<b<<endl;
     
       return 0;
}