#include <iostream>
using namespace std;

void swapv (int a,int b)
{
    int tmp=a;
    a=b;
    b=tmp;
}

void swapp(int *fa,int *fb)
{
	int tmp;
	tmp=*fa;
	*fa=*fb;
	*fb=tmp;
}

void swapr(int &a,int &b)
{
	int tmp=a;
	a=b;
	b=tmp;
}

int main()
{
	int a=10,b=20;
	swapv(a,b);
	cout<<a<<" "<<b<<endl;
	swapp(&a,&b);
	cout<<a<<" "<<b<<endl;
	swapr(a,b);
	cout<<a<<" "<<b<<endl;
	return 0;
}
