摘要:
//例子引自c++标准程序库P157页,见有会员问,我还硬是把这些代码重新敲了一次,最近也在自学stl,就当练习一下,注释全部翻译成中文了,希望能够帮到你#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;int ma... 阅读全文
摘要:
#include <iostream>#include <string>using namespace std;int main(int argc,char** argv){const string delims(" \t,.;");string line;while(getline(cin,line)){string::size_type begIdx,endIdx;be... 阅读全文
摘要:
#include <bitset>#include <iostream>#include <string>#include <limits>using namespace std;int main(){cout<<"267 as binary short: "<<bitset<numeric_limits<unsi... 阅读全文
摘要:
#ifndef STACK_HPP#define STACK_HPP#include <deque>#include <exception>template <class T>class stack{protected:std::deque<T> c;public:class ReadEmptyStack : public std::bad_exce... 阅读全文
摘要:
#include "algostuff.hpp"//见http://www.cnblogs.com/qnbs1/articles/1709197.htmlusing namespace std;int main(){vector<int>coll;INSERT_ELEMENTS(coll,3,7);INSERT_ELEMENTS(coll,3,9);INSERT_ELEMENTS(co... 阅读全文