You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
495 B
C++
21 lines
495 B
C++
#define _CRT_SECURE_NO_WARNINGS
|
|
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
char str1[1 << 10], str2[1 << 10];
|
|
|
|
int main() {
|
|
scanf("%s%s", str1, str2);
|
|
int ans = 0, prev = -1, len = strlen(str1);
|
|
for (int i = 0; i < len; i++)
|
|
if (str1[i] != str2[i])
|
|
if (~prev)
|
|
ans += i - prev, prev = -1;
|
|
else
|
|
prev = i;
|
|
printf("%d", ans);
|
|
return 0;
|
|
}
|