Pagini recente » Cod sursa (job #22074) | Cod sursa (job #102665) | Cod sursa (job #1141007) | Cod sursa (job #2084818) | Cod sursa (job #338708)
Cod sursa(job #338708)
var a:char;
f1,f2:text;
ctcuv,ctlit,ctlitcon,i:longint;
begin
assign(f1,'text.in');
reset(f1);
assign(f2,'text.out');
rewrite(f2);
ctcuv := 0;
ctlit := 0;
ctlitcon := 0;
while not(eof(f1)) do
begin
read(f1, a);
if (a in ['a'..'z', 'A'..'Z']) then inc(ctlitcon)
else
begin
if (ctlitcon > 0) then inc(ctcuv);
ctlit := ctlit + ctlitcon;
ctlitcon := 0;
end;
end;
if (ctlitcon > 0) then inc(ctcuv);
write(f2, ctlit div ctcuv);
close(f1);
close(f2);
end.