EUCLID • 15天前
#include<bits/stdc++.h>
//#include<time.h>
//#include<windows.h>
#define LL long long
using namespace std;
vector<string>vct;
int main(){
string s,str;
int cnt=0;
getline(cin,s);
for(char w:s){
if(('a'<=w&&w<='z')||('A'<=w&&w<='Z'))str+=w;
else{
vct.push_back(str);
cnt++;
str.clear();
}
}
sort(vct.begin(),vct.end());
cout<<cnt<<endl;
for(string S:vct){
cout<<S<<endl;
}
return 0;
}
评论: