Pagini recente » Cod sursa (job #2818277) | Cod sursa (job #2477309) | Cod sursa (job #1691960) | Cod sursa (job #379055) | Cod sursa (job #331708)
Cod sursa(job #331708)
Program t_ext;
var f,g:text; ncar,ncuv:longint;
procedure initiere;
begin
assign (f,'text.in'); reset (f);
assign (g,'text.out'); rewrite (g);
end;
procedure incheiere;
begin
close (f); close (g);
end;
procedure calcul;
var x:char; y:set of char;
begin
y:=['a'..'z']+['A'..'Z'];
ncuv:=0; ncar:=0;
while not eoln (f) do begin
x:='1';
while not (x in y) and not eoln (f) do read (f,x);
if not eoln (f) then inc (ncuv);
while (x in y) and not eoln (f) do begin
read (f,x);
inc (ncar);
end;
if x in y then inc (ncar);
end;
if ncuv=0 then writeln (g,0) else writeln (g,trunc (ncar/ncuv));
end;
begin
initiere;
calcul;
incheiere;
end.