6 条题解

  • 0
    @ 2025-10-22 23:36:14

    由于增加了换行符,所以只需要在读入字符串后删去最后一个字符即可。

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        freopen("log.in","r",stdin);
        freopen("log.out","w",stdout);
        string s;
        cin>>s;
        s.erase(s.end()-1);
        cout<<s.size();
    }
    

    是运行时间最多的……

    信息

    ID
    2
    时间
    1000ms
    内存
    512MiB
    难度
    2
    标签
    递交数
    118
    已通过
    25
    上传者