#include <iostream>

template <class T> void swap(T& a, T& b) {
	T tmp;

	tmp = a;
	a = b;
	b = tmp;
}

int main()
{
	int a=1, b=2;

	swap(a, b);
	std::cout << a << " " << b << "\n";

	double x=1., y=2.;

	swap(x, y);
	std::cout << x << " " << y << "\n";
}
