Pagini recente » Cod sursa (job #2520352) | Cod sursa (job #2443817) | Cod sursa (job #652572) | Cod sursa (job #2163577) | Cod sursa (job #488217)
Cod sursa(job #488217)
var f:text;
c,x:char;
db,szo:longint;
begin
assign(f,'text.in');
reset(f);
db:=0; szo:=0;
read(f,x);
if ((x>='a')and(x<='z'))or((x>='A')and(x<='Z')) then begin inc(db); inc(szo) end;
while not eof(f) do begin
read(f,c);
if ((c>='a')and(c<='z'))or((c>='A')and(c<='Z')) then inc(db)
else if (((x>='a')and(x<='z'))or((x>='A')and(x<='Z'))) then inc(szo);
x:=c;
end;
if (((x>='a')and(x<='z'))or((x>='A')and(x<='Z'))) then inc(szo);
close(f);
assign(f,'text.out');
rewrite(f);
if szo=0 then write(f,0)
else write(f,db div szo);
close(f);
end.