返回题解分享
讨论 / 题解分享/ 帖子详情

拓拓在打字 - 题解

#include <bits/stdc++.h>
using namespace std;

int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);

string s;
string c;
getline(cin,s);
for(int i=0;i<s.length();++i)
{
if(i==0||i==s.length()-1)
c.push_back(s[i]);
if(i>0&&i<=s.length()-2)
{
if(s[i] ==' '&&s[i+1]==' ')
{
continue;
}
else
c.push_back(s[i]);
}
}
cout<<c<<"\n";
return 0;
}
0 回复 0 转发 0 喜欢 5 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!