Pagini recente » Cod sursa (job #1687208) | Cod sursa (job #2989176) | Cod sursa (job #902890) | Cod sursa (job #1087043) | Cod sursa (job #44985)
Cod sursa(job #44985)
var n,cuvinte:byte;
c1,c2:char;
f,g:text;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
n:=0;
cuvinte:=0;
c1:=chr(10);
while not eof(f) do begin
read(f,c2);
if (((65<=ord(c2)) and (ord(c2)<=90)) or ((ord(c2)>=97) and (ord(c2)<=122))) then inc(n);
if ((ord(c1)>122) or (ord(c1)<65) or ((ord(c1)<97) and (ord(c1)>90))) and (((65<=ord(c2)) and (ord(c2)<=90))
or ((ord(c2)>=97) and (ord(c2)<=122))) then inc(cuvinte);
c1:=c2;
if eoln(f) then c1:=chr(10);
end;
write(g,trunc(n/cuvinte));
close(g);
end.