解题思路:
注意事项:
参考代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String a=scanner.next();
String b=scanner.next();
if(a.length()==b.length()) {
if(a.compareTo(b)==0)
System.out.print(2);
else if(a.compareToIgnoreCase(b)==0) //a.compareTo(b)!=0&&a.compareToIgnoreCase(b)==0
System.out.print(3);
else //a.compareTo(b)!=0&&a.compareToIgnoreCase(b)!=0
System.out.print(4);
}
else
System.out.print(1);
}
}
:
0.0分
0 人评分