1627: 单词
金币值:1
定数:1
时间限制:1.000 s
内存限制:128 M
正确:7
提交:162
正确率:4.32% 命题人:
题目描述
统计某个单词在一段文字中出现的次数。
输入格式
两行:
第1行为一个单词
第2行为一段中英文,其中包含了.,?!,。:"符号
输出格式
一个整数
输入样例1 复制
my
After my undergraduate studies, I have a passion for more academic achievement in finance.
输出样例1 复制
1
输入样例2 复制
The
There are many teenage champions such as Gu Ailing, Su Yiming, and so on who have encouraged us a lot. Obviously, they have something in common. They are trying to challenge themselves and never fear failing. Besides, they all have strong ambitions to do their best to reach the top level that they dream of. There is no denying that we should learn from them and treat them as models in our lives. Furthermore, it would be more beneficial if we could challenge ourselves all the time. With persistence and determination, we will succeed.改进点:1. "commen" 应为 "common",拼写错误。 "challege" 应为 "challenge",拼写错误。3. "dreamed of" 更合适的表达是 "dream of",因为这里指的是他们现在的理想,而不是过去的梦想。
输出样例2 复制
2
提示
读取一行,使用Scanner类的nextLine()方法