上一页 1 ··· 6 7 8 9 10 11 12 下一页
摘要: #include<iostream>#include<cstring>using namespace std;void main(){const char*state1="florida";const char*state2="kansas";const char*state3="euphoria";int len=strlen(state2);cout<<"increasing loop index;\n";int i;for(i=1;i<=len;i++){ cout. 阅读全文
posted @ 2013-02-23 15:40 叶城宇 阅读(368) 评论(0) 推荐(0)
摘要: #include<iostream>#include<sstream>using namespace std;void main(){freopen("testdata.txt","rt",stdin);for(string s;getline(cin,s); ){ int a,sum=0; for(istringstream a1(s);a1>>a;sum+=a); cout<<sum<<endl;}} 阅读全文
posted @ 2013-02-23 15:12 叶城宇 阅读(134) 评论(0) 推荐(0)
摘要: #include<iostream>#include<vector>#include<algorithm>#include<string>using namespace std;struct R{ string title; int rating;};bool operator<(const R&r1,const R&r2);bool worsethan(const R&r1,const R&r2);bool fillR(R& rr);void showR(const R& rr);void 阅读全文
posted @ 2013-02-23 15:10 叶城宇 阅读(168) 评论(0) 推荐(0)
摘要: #include<iostream>#include<vector>#include<string>using namespace std;struct R{ string title; int rating;};bool fillr(R & rr);void showr(const R & rr);void main(){vector<R>books;R temp;while(fillr(temp)) books.push_back(temp);int num=books.size();cout<<"siz 阅读全文
posted @ 2013-02-23 15:09 叶城宇 阅读(185) 评论(0) 推荐(0)
摘要: #include<iostream>#include<algorithm>#include<iterator>#include<set>#include<string>using namespace std;void main(){ const int N=6; string s1[N]={"buffoon","thinkers","for","heavy","can","for"}; string s2[N]={& 阅读全文
posted @ 2013-02-23 15:08 叶城宇 阅读(160) 评论(0) 推荐(0)
摘要: #include<iostream>#include<algorithm>#include<queue>using namespace std;void main(){ queue<int>s; s.push(1); s.push(2); s.push(3); cout<<"size::"<<s.size()<<endl; cout<<"front::"<<s.front()<<endl; cout<<"back: 阅读全文
posted @ 2013-02-23 15:06 叶城宇 阅读(121) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>#include<map>#include<algorithm>using namespace std;typedef int keytype;typedef pair<const keytype,string> pair1;typedef multimap<keytype,string> mapcode;void main(){ mapcode codes;codes.insert(pair1(415,"san francisco") 阅读全文
posted @ 2013-02-23 15:05 叶城宇 阅读(172) 评论(0) 推荐(0)
摘要: #include<iostream>#include<algorithm>#include<string>#include<map>using namespace std;/*struct T1{ int v; bool ope1(const T1&a){ return(v<a.v); }};struct T2{ int v;};struct cmp{ const bool op(const T2 &a,const T2 &b ) { return (a.v<b.v);}};*/void mian(){ //m 阅读全文
posted @ 2013-02-23 15:04 叶城宇 阅读(148) 评论(0) 推荐(0)
摘要: #include<iostream>#include<list>#include<iterator>using namespace std;void main(){list<int>one(5,2);int stuff[5]={1,2,4,8,6};list<int>two;two.insert(two.begin(),stuff,stuff+5);int more[6]={6,4,2,4,6,5};list<int>three(two);three.insert(three.end(),more,more+6);cout 阅读全文
posted @ 2013-02-23 15:03 叶城宇 阅读(127) 评论(0) 推荐(0)
摘要: #include<iostream>#include<list>#include<string>using namespace std;void main(){ list<int>lis; list<int>::iterator li; for(int i=0;i<3;i++) { lis.push_front(i), lis.push_back(i); } lis.sort(); cout<<"size::"<<lis.size()<<endl; for(li=lis.b 阅读全文
posted @ 2013-02-23 15:02 叶城宇 阅读(132) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 下一页