民生科技银行

题目:

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();//答案
		String t = scanner.next();//人写的答案
		int len = s.length();
		int right = 0;
		for (int i = 0; i < len; i += 4) {//每四个对比
			String temp = s.substring(i, i+4);
			if(temp.equals(t.substring(i, i+4))) {
				right++;
			}
		}
		System.out.println(right);
	}
}

输入:

10000100
10000100

输出:

2
posted @ 2021-11-14 20:14  猪猪猪猪侠  阅读(31)  评论(0编辑  收藏  举报