cznczai

题意一定要看清楚 ~~~~~~~~~~~~~~~~~~ 是 i I   O 跟0  (不要看成 1 跟 I)
题意一定要看清楚 ~~~~~~~~~~~~~~~~~~ 是 i I   O 跟0  (不要看成 1 跟 I)
题意一定要看清楚 ~~~~~~~~~~~~~~~~~~ 是 i I   O 跟0  (不要看成 1 跟 I)

 
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			int T = sc.nextInt();
			while (T-- > 0) {
				int length = sc.nextInt();
				String str1 = sc.next();
				String str2 = sc.next();
				boolean flag = true;
				for (int i = 0; i < length; i++) {
					if (str1.charAt(i) == str2.charAt(i)) {
					} else {
						if (str1.charAt(i) == \'O\' && str2.charAt(i) == \'0\') {
						} else if (str1.charAt(i) == \'0\' && str2.charAt(i) == \'O\') {
						} else if (str1.charAt(i) == \'I\' && str2.charAt(i) == \'l\') {
						} else if (str1.charAt(i) == \'l\' && str2.charAt(i) == \'I\') {
						} else {
							flag = false;
							System.out.println("NO");
							break;
						}
					}
				}
				if (flag)
					System.out.println("OK");
			}
		}
	}
}

分类:

技术点:

相关文章:

  • 2022-02-01
  • 2021-08-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-27
  • 2021-05-06
  • 2021-11-17
猜你喜欢
  • 2021-08-26
  • 2022-12-23
  • 2022-01-09
  • 2021-11-08
  • 2021-08-26
  • 2021-11-01
  • 2021-11-08
相关资源
相似解决方案