参考代码:
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语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:538 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:559 |
【密码】 (C语言代码)浏览:337 |
不容易系列 (C语言代码)浏览:680 |
ASCII帮了大忙浏览:763 |
哥德巴赫曾猜测 (C语言代码)浏览:2375 |
C语言训练-亲密数 (C语言代码)浏览:686 |
陈教主的三角形 (C语言代码)浏览:1165 |
C语言训练-大、小写问题 (C语言代码)浏览:685 |
A+B for Input-Output Practice (I) (C语言代码)浏览:585 |