模拟就完事了
import java.util.;
class Main{
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
String s=in.next();
String s2=in.next();
char c[]=s.toCharArray();
char c1[]=s2.toCharArray();
int ans=0;
for(int i=0;i<c.length-1;i) {
if(c[i]!=c1[i]) {
ans;
if(c[i]==’’) {
c[i]=’o’;
}else {
c[i]=’’;
}
if(c[i+1]==’’) {
c[i+1]=’o’;
}else {
c[i+1]=’*’;
}
}
}
System.out.println(ans);
}
}
代码前后加上```