***After a long night of coding, Charles Pearson Peterson is having trouble sleeping. This is not only because he is still thinking about the problem he is working on but also due to drinking too much java during the wee hours. This happens frequently, so Charles has developed a routine to count sheep. Not the animal, but the word. Specifically, he thinks of a list of words, many of which are close in spelling to “sheep”, and then counts how many actually are the word “sheep”. Charles is always careful to be case-sensitive in his matching, so “Sheep” is not a match. You are to write a program that helps Charles count “sheep”.
Input
Input will consist of multiple problem instances. The first line will consist of a single positive integer n ≤ 20, which is the number of problem instances. The input for each problem instance will be on two lines. The first line will consist of a positive integer m ≤ 10 and the second line will consist of m words, separated by a single space

该程序用于帮助Charles Pearson Peterson计算输入单词列表中单词'sheep'出现的次数,考虑大小写敏感性。给定多个问题实例,每个实例包含单词列表,需输出含有'sheep'的单词数量。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



