Pagini recente » Cod sursa (job #1057510) | Cod sursa (job #284621)
Cod sursa(job #284621)
var f,g:text;
ok1,ok2:boolean;
x:char;
numar_litere,numar_cuvinte:longint;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
numar_cuvinte:=0;
numar_litere:=0;
while not eof(f) do begin
ok1:=false;
ok2:=false;
while not eoln(f) do begin
read(f,x);
if x in ['a'..'z','A'..'Z'] then ok2:=true
else ok2:=false;
if not ok1 and ok2 then inc(numar_cuvinte);
if ok2 then inc(numar_litere);
ok1:=ok2;
end;
readln(f);
end;
writeln(g,numar_litere div numar_cuvinte);
close(f);
close(g);
end.