标签:style blog color io os ar for div sp
1 #include <iostream> 2 using namespace std; 3 4 5 void swap(int& x,int& y) 6 { 7 y = x + y; 8 x = y - x; 9 y = y - x; 10 } 11 12 int _tmain(int argc, _TCHAR* argv[]) 13 { 14 int a = 10, b=20; 15 cout << "before swap: a= "<<a <<" b= "<<b<<endl; 16 17 swap(a,b); 18 cout <<"after swap: a= "<<a << " b= "<<b<<endl; 19 20 return 0; 21 }
标签:style blog color io os ar for div sp
原文地址:http://www.cnblogs.com/disemboltura/p/3990471.html