Pagini recente » Cod sursa (job #1807808) | Cod sursa (job #2353217) | Cod sursa (job #1530975) | Cod sursa (job #2953389) | Cod sursa (job #291816)
Cod sursa(job #291816)
program test;
var be,ki:text;
nrcuvinte,lungcuvinte:longint;
c:char;
H,sep:set of char;
procedure kihagyasok;
begin
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;
{c:=' ';
kihagyasok;
if eoln(be) then begin writeln(ki,0);close(ki);halt;end;
repeat
if c in sep then inc(nrcuvinte);
kihagyasok;
while not(c in sep) do
begin
if c in h then inc(lungcuvinte);
if eoln(be) then break
else read(be,c);
end
until eoln(be);}
{writeln(lungcuvinte);
writeln(nrcuvinte);
writeln(lungcuvinte / nrcuvinte:6:6);
writeln(lungcuvinte div nrcuvinte);
readln;}
{ujfajta izee}
repeat
read(be,c);
if c in h then inc(lungcuvinte)
until eoln(be);
close(be);
reset(be);
repeat
read(be,c);
if c in sep then
begin
inc(nrcuvinte);
kihagyasok;
end
until eoln(be);
writeln(ki,lungcuvinte div nrcuvinte);
close(ki);
end.