/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
template <typename T>
void swap(T& a, T& b)
{
if (a != b)
{
a ^= b;
b ^= a;
a ^= b;
}
}
int main()
{
std::cout<<"int\n";
{
int a = 5;
int b = 10;
std::cout<<"a "<<a<<" b "<<b;
swap(a, b);
std::cout<<"\na "<<a<<" b "<<b;
}
std::cout<<"vector\n";
{
std::vector<int> a{3,56,2,1,54,2};
std::vector<int> b{543,51,45,34,2,4};
std::cout<<"a ";
for (auto i: a)
std::cout << i << ' ';
std::cout<<"\nb ";
for (auto i: b)
std::cout << i << ' ';
swap(a, b);
std::cout<<"\na ";
for (auto i: a)
std::cout << i << ' ';
std::cout<<"\nb ";
for (auto i: b)
std::cout << i << ' ';
}
return 0;
}