解题思路:
注意事项:
参考代码:
public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s1 = scanner.nextLine();
String s2 = scanner.nextLine();
System.out.println(removeSpace(s1).equals(removeSpace(s2)) ? "YES" : "NO");
}
public static String removeSpace(String s) {
s = s.toLowerCase();//变为小写
char[] chars = new char[s.length()];
int i = 0, index = 0;
while (index < s.length()) {
if (s.charAt(index) != ' ') {
chars[i++] = s.charAt(index);
}
index++;
}
String str = new String(chars);
return str.substring(0, i);
}
}
0.0分
0 人评分
简单的a+b (C语言代码)浏览:667 |
A+B for Input-Output Practice (C++代码)浏览:605 |
回文串 (C语言代码)浏览:2846 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:326 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:606 |
蚂蚁感冒 (C语言代码)浏览:1319 |
DNA (C语言代码)浏览:391 |
Hello, world! (C语言代码)浏览:821 |
格式化数据输出 (C语言代码)浏览:811 |
简单的a+b (C语言代码)浏览:531 |