Pagini recente » Cod sursa (job #3294571) | Cod sursa (job #2735038) | Cod sursa (job #1425719) | Cod sursa (job #3225632) | 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.