Cod sursa(job #2278921)
Utilizator | Data | 8 noiembrie 2018 18:21:04 | |
---|---|---|---|
Problema | Text | Scor | 80 |
Compilator | py | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
with open("text.in") as f:
text = f.read()
import re
pattern = re.compile('[A-z]+')
text = pattern.findall(text)
cuv = len(text)
l = 0
for i in text:
if i == '':
cuv -= 1
l += len(i)
with open("text.out", 'w') as g:
if cuv:
g.write(str(l // cuv))
else:
g.write(str(0))