fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. void Swap(int &a, int &b){
  7. a ^= b ^= a ^= b;
  8. }
  9.  
  10. int main(int argc, char ** argv){
  11. int a = 1, b = 1;
  12. Swap(a, a);
  13. swap(b, b);
  14. cout << a << ' ' << b << '\n';
  15. return 0;
  16. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
0 1