参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str1 = scan.nextLine(); String str2 = scan.nextLine(); int type = -1; if( str1.length() != str2.length() ) type = 1; else if( str1.compareTo(str2) == 0 ) type = 2; else if( str1.equalsIgnoreCase(str2))type = 3; else type = 4; System.out.println( type ); } }
0.0分
0 人评分