Pagini recente » Cod sursa (job #2807703) | Cod sursa (job #1906480) | Cod sursa (job #1017474) | Cod sursa (job #324109) | Cod sursa (job #900199)
Cod sursa(job #900199)
program text_i;
const m:set of char=['a'..'z','A'..'Z'];
var f,g:text;
lit,c,ch,sp:real;
cuv:boolean;
x,a:char;
rez:longint;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
cuv:=false; lit:=0; c:=0; ch:=0;
while not eof(f) do begin
read(f,x); ch:=ch+1;
if [x]<=m then begin
cuv:=true;
lit:=lit+1;
end
else if ([a]<=m) and (ch>1) then
begin
cuv:=false;
c:=c+1;
end;
if not([x]<=m) then cuv:=false;
a:=x;
end;
rez:=trunc(lit/c);
writeln(g,rez);
close(f); close(g);
end.