#include <iostream>
using namespace std;
void func(int &a, int &b);
int main(void)
{
int x = 10;
int y = 20;
cout << x << " " << y << endl; // 10 20
func(x, y);
cout << x << " " << y << endl; // 20 10
system("pause");
return 0;
}
void func(int &a,int &b)
{
int c = 0;
c = a;
a = b;
b = c;
}