Pagini recente » Cod sursa (job #2919171) | Cod sursa (job #2307160) | Cod sursa (job #184107) | Borderou de evaluare (job #1703669) | Cod sursa (job #601331)
Cod sursa(job #601331)
Program texte;
var litere:set of char;
ch:char;
suma,cuvinte:longint;
f:text;
begin
assign(f,'text.in'); reset(F); read(f,ch);
litere:=['a'..'z','A'..'Z']; suma:=0; cuvinte:=0;
while not eof(f) do begin
while not eoln(f) do begin
while ( ch<'A') or( ch>'z') or (ch >'Z') and (ch<'a') do read(f,ch);
if ( ch>='A')and(ch<='Z')or(ch>='a')and(ch<='z') then inc(cuvinte);
while ( ch>='A')and(ch<='Z')or(ch>='a')and(ch<='z') do begin
inc(suma);
read(f,ch);
end;
end;
readln(f);
end;
close(f); assign(f,'text.out'); rewrite(f);
writeln(f,suma div cuvinte); close(f);
end.