解题思路:
注意事项:
参考代码:
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//输入单词
String word = scanner.nextLine();
if (word.endsWith("er") || word.endsWith("ly") ) {
word = word.substring(0,word.length() - 2);
}else if(word.endsWith("ing")){
word=word.substring(0,word.length()-3);
}
//endsWith() 方法用于测试字符串是否以指定的后缀结束
//substring()方法用于截取字符串中的最后几个字符
System.out.println(word);
}
}
0.0分
0 人评分
【亲和数】 (C语言代码)浏览:492 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:567 |
C语言训练-阶乘和数* (C语言代码)-------- 呆板写法浏览:1345 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:685 |
Cylinder (C语言描述+详细分析)浏览:3263 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:560 |
简单的a+b (C语言代码)浏览:543 |
时间转换 (C语言代码)浏览:625 |
数组输出 (C语言代码)浏览:700 |
理财计划 (C语言代码)浏览:467 |