参考代码:
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 人评分
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:759 |
WU-printf基础练习2 (C++代码)浏览:2007 |
Cylinder (C语言描述,蓝桥杯)浏览:1247 |
水仙花 (C语言代码)浏览:1052 |
回文数字 (C语言代码)浏览:2510 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:810 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:476 |
A+B for Input-Output Practice (V) (C语言代码)浏览:469 |
星期判断机 (C语言代码)浏览:859 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:706 |