zoukankan      html  css  js  c++  java
  • 6471.电子锁

    题意一定要看清楚 ~~~~~~~~~~~~~~~~~~ 是 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");
    			}
    		}
    	}
    }
    
  • 相关阅读:
    js取当前时间的秒级时间戳
    微信自动聊天脚本
    小程序 缓存过期问题
    去掉表格默认样式
    css3 画心
    数据导入(二):MapReduce
    数据导入(一):Hive On HBase
    HBase参数优化
    Hadoop运维手记
    HBase优化相关
  • 原文地址:https://www.cnblogs.com/cznczai/p/11150028.html
Copyright © 2011-2022 走看看