online_judge_1099
来源:互联网 发布:java poi jar 编辑:程序博客网 时间:2024/04/30 16:35
#include <iostream>#include <set>#include <string>using namespace std;int main(){ string str; set<string> s; set<string>::iterator it; int i,len; while(getline(cin,str)) { s.clear(); len = str.size(); for(i=0; i<len; ++i) { s.insert(str.substr(i,len)); } for(it=s.begin(); it!=s.end(); ++it) cout<<*it<<endl; } return 0;}
用C++的STL做真是太简单了……
0 0