QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#773780#9578. 爱上字典laonongmin#Compile Error//C++23289b2024-11-23 10:19:192024-11-23 10:19:20

Judging History

你现在查看的是最新测评结果

  • [2024-11-23 10:19:20]
  • 评测
  • [2024-11-23 10:19:19]
  • 提交

answer

s = input().lower().split()
s = [ss.strip('.!,?') for ss in s if ss.strip('.!,?')]

n = int(input())
lst = []
for i in range(n):
    lst.append(input().lower().strip())

ans = 0
for ss in s:
    if ss:  # 检查字符串是否非空
        ans += lst.count(ss) == 0
print(ans)

详细

answer.code:2:15: warning: multi-character character constant [-Wmultichar]
    2 | s = [ss.strip('.!,?') for ss in s if ss.strip('.!,?')]
      |               ^~~~~~
answer.code:2:47: warning: multi-character character constant [-Wmultichar]
    2 | s = [ss.strip('.!,?') for ss in s if ss.strip('.!,?')]
      |                                               ^~~~~~
answer.code:11:13: error: stray ‘#’ in program
   11 |     if ss:  # 检查字符串是否非空
      |             ^
answer.code:1:1: error: ‘s’ does not name a type
    1 | s = input().lower().split()
      | ^