// 转换为目标状态
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N=110;
char start[N]; //初始状态
char aim[N]; // 目标状态
int ans;
void turn(int i){
if(start[i]=='*'){
start[i]='o';
}else{
start[i]='*';
}
}
int main(){
int n;
cin>>start>>aim;
n=strlen(start);
for(int i=0;i<n;i++){
if(start[i]!=aim[i]){
turn(i);
turn(i+1); //翻动相邻的两个硬币
ans++;
}
}
cout<<ans;
return 0;
}
标签:aim,1208,硬币,int,char,start,include,AcWing
From: https://www.cnblogs.com/mengfengguang/p/16857323.html