改了几次都有细节上的错误真的不知道该咋改了蹲一个解答感激不尽
a=input().split()
b={}
for x in a:
if x in b:
b[x]+=1
else:
b[x]=1
for k,v in b:
print(f'单词{k}出现的次数:{v}')
a=int(input())
b=int(input())
c=[]
i=2
while a>1 and b>1 and (i<a or i<b):
if a%i==0 and b%i==0:
c.append(i)
i=2
a//=i
b//=i
else:
i+=1
with open('e:/公因数.txt','w+') as file:
file.writelines(c)