题目链接
题目大意:有两种棋子,黑色棋子和白色棋子,然后要你把所有的棋子都弄成一个颜色的,
改变颜色的途径是,如果有一个黑色棋子,* 那么我在他的两边弄白色棋子他就会变色,/*/>>>///
代码:
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
int main()
{
string str;
cin>>str;
int ans=0;
for(int i=0;i<str.length()-1;i++)
{
if(str[i]!=str[i+1]) ans++;
}
cout<<ans<<endl;
}