要注意处理标点前的空格...不然就狂PE了...
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#define M 1000
using namespace std;
map<char,int>m;
map<char,int>::iterator it;
char str[M];
string ans;
int main()
{
// freopen("1951.txt","r",stdin);
// freopen("1951o.txt","w",stdout);
m['A']=1;
m['E']=1;
m['I']=1;
m['O']=1;
m['U']=1;
gets(str);
int n=strlen(str);
for(int i=0;i<n;i++)
{
if(str[i]<='Z'&&str[i]>='A')
{
if(m.find(str[i])==m.end())
{
ans+=str[i];
m[str[i]]=1;
}
}
else
{
if(str[i]==' ')
{
if(ans[ans.size()-1]!=' ')
ans+=str[i];
}
else
{
if(ans[ans.size()-1]==' ')ans[ans.size()-1]=str[i];
else
ans+=str[i];
}
}
}
n=ans.size()-1;
while(ans[n]==' ')n--;
int i=0;
while(ans[i]==' ')i++;
for(;i<=n;i++)printf("%c",ans[i]);
//cout<<s<<endl;
}