2 条题解

  • 0
    @ 2026-10-24 13:53:17
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n,j = 0;
        cin >> n;
        string s;
        cin >> s;
        for (int i = 0;i < s.size() - 1; i++)
        {
            if (s[i] == s[i+1])
            {
                j++;
            }
        }
        cout << j << endl;
    }
    //啦啦啦
    

    信息

    ID
    1774
    时间
    2000ms
    内存
    256MiB
    难度
    1
    标签
    提交数
    1
    已通过
    1
    上传者