C++ 代码
// 开始以为有多难的,还想着dfs这些,哎。。。。。
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
string s1,s2;
int n;
void turn(int i)
{
if(s1[i]=='o') s1[i] = '*';
else s1[i] = 'o';
}
int main()
{
cin >> s1 >> s2;
n = s1.length();
int res = 0;
for(int i = 0; i < n; i ++ )
{
if(s1[i]!=s2[i])
{
turn(i);
turn(i+1);
res++;
}
}
cout << res << endl;
return 0;
}