7
6
2015
0

XJOI 1423 交换

#include <iostream>
using namespace std;


int main(){
	int ans=0;
	string a,b;
	cin>>a>>b;
	for (int i=1;i<a.size()-1;++i){
		if (a[i-1]!=a[i+1]) continue;
		for (int j=1;j<b.size()-1;++j)
			if (b[j-1]==b[j+1] && b[j-1]==a[i] && a[i-1]==b[j])
				++ans;
	}
	cout<<ans;
	return 0;
}
Category: 题解 | Tags: XJOI | Read Count: 170

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com