solution.cpp 543 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a, b;
    cin >> a >> b;
    int a1 = a.size(), b1 = b.size(), ans = 0;
    for (int i = 0; i < a1; i++)
    {
        if (a[i] == b[i])
        {
            continue;
        }
        else
        {
            ans++;
            a[i] = b[i];
            if (a[i + 1] == '*')
            {
                a[i + 1] = 'o';
            }
            else
            {
                a[i + 1] = '*';
            }
        }
    }
    cout << ans << endl;
    return 0;
}