123
作者:
hayate
,
2024-08-02 11:09:11
,
所有人可见
,
阅读 8
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int main()
{
int N = 2;
int t;
cin >> t;
while(t -- )
{
int n;
vector<string> s(N);
cin >> n;
for(auto& x : s)
{
cin >> x;
}
int ans = 0;
for(int i = 1; i < n - 1; i ++ )
{
bool flag = true;
flag &= (s[0][i] == '.' && s[1][i] == '.');
flag &= (s[0][i - 1] != s[1][i - 1]);
flag &= (s[0][i + 1] != s[1][i + 1]);
flag &= (s[0][i - 1] == s[0][i + 1]);
ans += flag;
}
cout << ans << "\n";
}
return 0;
}