blob: 84f60f164332197fdc989dc1cc638baccf662fb8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <iostream>
#include <string>
inline void toggle(char &c) { c = c == '*' ? 'o' : '*'; }
int main() {
std::string original, expected;
std::cin >> original >> expected;
int size = original.size();
int count = 0;
for (int i = 0; i < size - 1; i++) {
if (original[i] != expected[i]) {
count++;
toggle(original[i + 1]);
}
}
std::cout << count;
return 0;
}
|