验证是否按照字母顺序排列, 不区分大小写
        for(int j=0;j<s.length-1;j++){
            String temp1=s[j].toLowerCase();
            String temp2=s[j+1].toLowerCase();
            System.out.println("temp1="+temp1);
            for(int k=0;k<temp1.length()&&k<temp2.length();k++){
                System.out.println("temp1.charAt(k)="+temp1.charAt(k));
                System.out.println("temp2.charAt(k)="+temp2.charAt(k));
                if(temp1.charAt(k)<temp2.charAt(k)){
                    break;
                }
                if(temp1.charAt(k)>temp2.charAt(k)){
                    fail("the option is not in order");
                }
            }
        }

相关文章:

  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案