/*
	© MATTO MATTI 2015
	http://mattomatti.com/pl/a07
	napisane przy użyciu Visual Studio Community 2015
	2015-07-03 v 1.0
*/

#include <iostream>

using namespace std;

void swap(int &a, int &b) {
	a ^= b;
	b ^= a;
	a ^= b;
}

void swap(int* a, int* b, int n) {
	while (n--)
		swap(a[n], b[n]);
}

void wypiszListe(int* a, int n) {
	int i = 0;
	while (n--)
		cout << a[i++] << " ";
	cout << endl;
}

int main() {
	int n = 5;
	int a[] = { 1, 3, 34, 5, 6 };
	int b[] = { 11, 31, 3, 19, 2 };
	cout << "Przed zamiana:" << endl;
	wypiszListe(a, n);
	wypiszListe(b, n);
	swap(a, b, n);
	cout << "Po zamianie:" << endl;
	wypiszListe(a, n);
	wypiszListe(b, n);
	system("pause");
	return 0;
}