Pagini recente » Cod sursa (job #22753) | Cod sursa (job #559862) | Cod sursa (job #489205) | Cod sursa (job #2711140) | Cod sursa (job #2528377)
import string
if __name__ == '__main__':
total = 0
nrLitere = 0
with open('text.in','r') as fh:
line = fh.readline()
newWord = False
for c in line:
if c not in string.ascii_letters:
if newWord==True:
total += 1
newWord = False
else:
nrLitere += 1
if newWord == False:
newWord = True
if newWord == True:
total += 1
print(nrLitere)
print(total)
open('text.out','w').write("%d"%(nrLitere//total))