NC215138. AlgorithmCourse
描述
输入描述
There is only one test case in each test file.
The first and only line contains a string () which only contains lower-cased English letters.
输出描述
Output one line containing one integer indicating the total number of occurrence of "cat" and "dog" in the string.
示例1
输入:
catcatcatdogggy
输出:
4
示例2
输入:
docadosfascat
输出:
1
示例3
输入:
icpcnanjing
输出:
0
Python3(3.9) 解法, 执行用时: 18ms, 内存消耗: 2804K, 提交时间: 2020-12-20 14:38:37
a=input() print(a.count('dog')+a.count('cat'))