P8597 [蓝桥杯 2013 省 B] 翻硬币
AC

import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String s1 = sc.nextLine();String s2 = sc.nextLine();char[] c1 = s1.toCharArray();char[] c2 = s2.toCharArray();int t = c1.length - 1;int sum = 0;for(int i=0;i<t;i++) {if(c1[i]!=c2[i]) {if(c1[i] == '*') {c1[i] = 'o';if(c1[i+1] == '*') {c1[i+1] = 'o';}else {c1[i+1] = '*';}sum++;}else {c1[i] = '*';if(c1[i+1] == '*') {c1[i+1] = 'o';}else {c1[i+1] = '*';}sum++;}}}System.out.println(sum);}}