Pagini recente » Cod sursa (job #2334847) | Statistici Anastasei Tudor (anastasei_tudor) | Cod sursa (job #2501329) | Cod sursa (job #1665583) | Cod sursa (job #291821)
Cod sursa(job #291821)
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);
read(be,c);
while (c in sep) do
begin
if eoln(be) then break;
read(be,c);
end;
repeat
read(be,c);
if c in sep then kihagyasok
until eoln(be);
if not(c in sep) then inc(nrcuvinte);
writeln(ki,lungcuvinte div nrcuvinte);
close(ki);
end.