15 条题解

  • 0
    @ 2025-4-6 14:22:52

    #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;
    

    }

    信息

    ID
    11
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    2203
    已通过
    961
    上传者