Pagini recente » Cod sursa (job #2776457) | Cod sursa (job #590430) | Cod sursa (job #2629311) | Cod sursa (job #50182) | Cod sursa (job #44952)
Cod sursa(job #44952)
var a:array[1..256] of char;
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;
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;
end;
write(g,trunc(n/cuvinte));
close(g);
end.