#include<iostream>
using namespace std;
int main()
{
int a;
cin >> a;
char b[50];
b[a] = '\0';
int c=0;
cin >> b;
for (int i = 0; i < a-1; i++)
{
if (b[i] == b[i + 1])
c++;
}
cout << c;
}
#include<iostream>
using namespace std;
int main()
{
int a;
cin >> a;
char b[50];
b[a] = '\0';
int c=0;
cin >> b;
for (int i = 0; i < a-1; i++)
{
if (b[i] == b[i + 1])
c++;
}
cout << c;
}
本文标题:2018-12-07acm第三题
本文链接:https://www.haomeiwen.com/subject/fkmthqtx.html
网友评论