Pagini recente » Cod sursa (job #3154111) | Cod sursa (job #1958701) | Cod sursa (job #2546239) | Cod sursa (job #2290966) | 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.