本文共 326 字,大约阅读时间需要 1 分钟。
#include <cstdlib>#include <iostream>using namespace std;void swap(int &a, int &b){ a = a ^ b; b = b ^ a; a = a ^ b; }int main(int argc, char *argv[]){ int a = 9; int b = 10; swap(a, b); cout << "a: " << a << endl; cout << "b: " << b << endl; system("PAUSE"); return EXIT_SUCCESS;}
转载地址:http://nbkqb.baihongyu.com/