摘要:
1 #include <iostream> 2 using namespace std; 3 4 void swap( 5 int* &a,int* &b 6 ) 7 { 8 int * tmp = a; 9 a = b; 10 b = tmp; 11 } 12 int main() 13 { 14 阅读全文
摘要:
1 #include <iostream> 2 using namespace std; 3 class A 4 { 5 public: 6 int x; 7 int getX() { return x; } 8 }; 9 void swap( 10 A& a,A& b 11 ) 12 { 13 i 阅读全文
摘要:
multiset和set区别在于 前者可包含重复元素 1.创建一个set变量set2 用来记录进入过整数集的整数(利用唯一性),multiset变量mset用来管理整数集的所有整数(可包括重复的) 1 #include <iostream> 2 #include <set> 3 #include < 阅读全文