Pagini recente » Cod sursa (job #2982072) | Cod sursa (job #1080537) | Cod sursa (job #708456) | Cod sursa (job #995106) | Cod sursa (job #562711)
Cod sursa(job #562711)
Program iatext;
var f:text;
c:char;
nr,nc,i:integer;
begin
assign(f,'text.txt'); reset(f);
i:=0;
nr:=0;
nc:=0;
While not eof(f) do begin
read(f,c);
If c in ['a'..'z','A'..'Z'] then begin inc(nc);
If i=0 then inc(nr);
i:=1;
end
else i:=0;
end;
close(f);
If nr>0 then writeln(trunc(nc/nr))
else writeln('nu exista cuvinte in fisier');
end.