2013年4月28日
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 #include <valarray>10 using namespace std;11 12 13 void print(int i)14 {15 cou 阅读全文
posted @ 2013-04-28 23:17 宇睿 阅读(208) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 using namespace std;10 11 12 class Student13 {14 private:15 int sno;16 public:17 Stu 阅读全文
posted @ 2013-04-28 22:57 宇睿 阅读(260) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 using namespace std;10 void print(const string s)11 {12 cout<<s<<endl;13 阅读全文
posted @ 2013-04-28 22:30 宇睿 阅读(261) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 using namespace std;10 map<string,int> map_meng;11 12 void print(const pair< 阅读全文
posted @ 2013-04-28 22:13 宇睿 阅读(144) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 using namespace std;10 map<string,int> map_meng;11 12 void print(const pair< 阅读全文
posted @ 2013-04-28 22:05 宇睿 阅读(169) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 using namespace std; 9 ostream_iterator < string > oo(cout);10 int main()11 {12 string from,to;13 cin 阅读全文
posted @ 2013-04-28 16:53 宇睿 阅读(153) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <iterator> 5 using namespace std; 6 ostream_iterator < string > oo(cout); 7 int main() 8 { 9 *oo="huhu";10 oo++;11 *oo=" hehe\n";12 13 14 return 0;15 } 阅读全文
posted @ 2013-04-28 16:35 宇睿 阅读(86) 评论(0) 推荐(0)
摘要: void f(vector<Entry>& ve,list<Entry>& le){ sort(ve.begin(),ve.end()); unique_copy(ve.begin(),ve.end(),le.begin());}void f(vector<Entry>&ve,list<Entry>&le){ sort(ve.begin(),ve.end()); unique_copy(ve.begin(),ve.end(),back_inserter(le));//append to le}void f(list 阅读全文
posted @ 2013-04-28 16:27 宇睿 阅读(136) 评论(0) 推荐(0)
摘要: vector <T>list<T>queue<T>deque<T>priority_queue<T>set<T>multiset<T>map<key,value>multimap<key,value> 阅读全文
posted @ 2013-04-28 16:01 宇睿 阅读(107) 评论(0) 推荐(0)
摘要: 冒号初始化是给数据成员分配内存空间时就进行初始化,就是说分配一个数据成员只要冒号后有此数据成员的赋值表达式(此表达式必须是括号赋值表达式),那么分配了内存空间后在进入函数体之前给数据成员赋值,就是说初始化这个数据成员此时函数体还未执行。 对于在函数中初始化,是在所有的数据成员被分配内存空间后才进行的。 阅读全文
posted @ 2013-04-28 15:22 宇睿 阅读(102) 评论(0) 推荐(0)