本题类似于费解的开关,只要固定了第一个状态,那么后面的状态都是已知的,只要做一次扫描,按题意更改状态即可
#include<iostream>
#include<vector>
using namespace std;
string st,ed;
int main(){
cin>>st>>ed;
int res=0;
for(int i=0;i<st.size();i++){
if(st[i]==ed[i])continue;
st[i]=ed[i];
if(st[i+1]=='*')st[i+1]='o';
else st[i+1]='*';
res++;
}
cout<<res<<endl;
return 0;
}