#include <iostream>
#include <set> //集合头文件
#include <string>
#include <sstream> //使用stringstream
using namespace std;
{
string s,buf;
while(cin>>s){ //电脑上调试得不出答案但是能AC 这也是我纳闷的地方
for (int i =0; i<s.length(); i++)
if (isalpha(s[i]))
s[i] = tolower(s[i]); //将大写字母转化为小写字母
else
s[i] = ' ';
stringstream ss(s); //将每行输入的单词放进ss
while (ss>>buf)
str.insert(buf); //j将分割好的单词放进集合集合自动给你排序
}
for (set<string>::iterator i = str.begin(); i != str.end(); i++)
cout<<*i<<endl;
return 0;
}
#include <set> //集合头文件
#include <string>
#include <sstream> //使用stringstream
using namespace std;
set<string> str;
{
string s,buf;
while(cin>>s){ //电脑上调试得不出答案但是能AC 这也是我纳闷的地方
for (int i =0; i<s.length(); i++)
if (isalpha(s[i]))
s[i] = tolower(s[i]); //将大写字母转化为小写字母
else
s[i] = ' ';
stringstream ss(s); //将每行输入的单词放进ss
while (ss>>buf)
str.insert(buf); //j将分割好的单词放进集合集合自动给你排序
}
for (set<string>::iterator i = str.begin(); i != str.end(); i++)
cout<<*i<<endl;
return 0;
}