with open("file1.txt", "r") as file1:
text1 = file1.read()
with open("file2.txt", "r") as file2:
text2 = file2.read()
words1 = set(text1.split())
count = 0
for word in text2.split():
if word in words1:
count += 1
print("文件2中的单词在文件1中出现的次数:", count)