JAVA 蓝桥杯基础练习 字符串对比
2018-04-01 15:26
351 查看
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
String st1, st2;
st1 = in.nextLine();
st2 = in.nextLine();
if (st1.length() != st2.length()) {
System.out.println(1);
} else if (st1.equals(st2)) {
System.out.println(2);
} else if (st1.toLowerCase().equals(st2.toLowerCase())&&!st1.equals(st2)) {
System.out.println(3);
} else {
System.out.println(4);
}
}
}
public class Main{
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
String st1, st2;
st1 = in.nextLine();
st2 = in.nextLine();
if (st1.length() != st2.length()) {
System.out.println(1);
} else if (st1.equals(st2)) {
System.out.println(2);
} else if (st1.toLowerCase().equals(st2.toLowerCase())&&!st1.equals(st2)) {
System.out.println(3);
} else {
System.out.println(4);
}
}
}
相关文章推荐
- java 蓝桥杯 基础练习 字符串对比
- 蓝桥杯 基础练习VIP 字符串对比(Java解题)
- java 蓝桥杯 基础练习 字符串对比
- (蓝桥杯)基础练习 字符串对比
- java 蓝桥杯 基础练习 FJ的字符串
- 蓝桥杯 [基础练习VIP] FJ的字符串(Java解题)
- 蓝桥杯 BASIC-15 基础练习 字符串对比
- 蓝桥杯基础练习BASIC-15 字符串对比
- 蓝桥杯_基础练习《字符串对比---29》
- 基础练习 字符串对比 蓝桥杯 水题
- 蓝桥杯 基础练习 字符串对比
- 蓝桥杯基础练习 字符串对比
- 蓝桥杯 BASIC-15 基础练习 字符串对比
- 蓝桥杯 基础练习 字符串对比
- java基础练习 字符串对比
- 蓝桥杯 15 基础练习 字符串对比
- 蓝桥杯基础练习字符串对比
- 基础练习 字符串对比
- java基础练习-统计字符串中每个字符出现的次数
- JAVA蓝桥杯-基础练习 闰年判断