Python3.0 代码太短了,不知道有什么问题,只有20分

P1308 [NOIP2011 普及组] 统计单词数

捕捉到一只灰
by 罗易辰 @ 2019-10-06 17:57:22


```python word = input().lower() sentence = list(input().lower().split()) S=0 if word in sentence: con = sentence.count(word) index = sentence.index(word) for i in range(index): S += (len(sentence[i]) + 1) print(con, S) else: print('-1') ``` 重新审题,换成字母出现的位置也只有20分。
by pissingboy @ 2019-10-06 18:06:29


|