Pagini recente » Cod sursa (job #1630150) | Cod sursa (job #840248) | Cod sursa (job #66273) | Cod sursa (job #1133038) | Cod sursa (job #727347)
Cod sursa(job #727347)
var f:text;
cl,cc:longint;
mid:longint;
c,next:char;
semn:boolean;
begin
cl:=0;
cc:=0;
assign(f, 'text.in');
reset(f);
cl:=0;
cc:=0;
read(f,c);
while not eoln(f) do
begin
if c in ['a'..'z','A'..'Z'] then cl:=cl+1;
next:=c;
while(next=' ') do read(f,next);
if (c=' ') then begin cc:=cc+1;cl:=cl+1; c:=next;end;
read(f,c);
end;
close(f);
assign(f, 'text.out');
rewrite(f);
cc:=cc+1;
mid:=cl div cc;
writeln(f, mid);
close(f);
end.