Pagini recente » Monitorul de evaluare | Cod sursa (job #184474) | Cod sursa (job #581243) | Cod sursa (job #209566) | Cod sursa (job #291818)
Cod sursa(job #291818)
program test;
var be,ki:text;
nrcuvinte,lungcuvinte:longint;
c:char;
H,sep:set of char;
procedure kihagyasok;
begin
if c in sep then inc(nrcuvinte);
while (c in sep) do
begin
if eoln(be) then exit;
read(be,c);
end;
end;
begin
h:=['A'..'Z','a'..'z'];
sep:=[' ','-'];
assign(be,'text.in');
assign(ki,'text.out');
reset(be);
rewrite(ki);
nrcuvinte:=0;
lungcuvinte:=0;
repeat
read(be,c);
if c in h then inc(lungcuvinte)
until eoln(be);
close(be);
reset(be);
kihagyasok;
repeat
read(be,c);
if c in sep then kihagyasok
until eoln(be);
writeln(ki,lungcuvinte div nrcuvinte);
close(ki);
end.