C++
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main ()
{
string s1,s2;
getline(cin,s1);
for(int i=0;i<s1.size();i++)
{
if(s1[i]!=’ ‘)
{
s2+=s1[i];//如果当前字符不是空格 储存到新字符中
}
else if(s1[i+1]!=’ ‘)//else(s1[i]=’ ‘)else if(s1[i+1)!=’ ‘
{
s2+=s1[i]; //如当前字符是空格 下一个字符不是空格 继续储存
}
}
cout<<s2;
return 0;
}