Pagini recente » Cod sursa (job #318113) | Cod sursa (job #1197669) | Monitorul de evaluare | Cod sursa (job #1184199) | Cod sursa (job #58202)
Cod sursa(job #58202)
program radu;
var s:string;
cuv,lung:longint;
x:char;
f,g:text;
begin
assign (f,'text.in');
reset (f);
assign (g,'text.out');
rewrite (g);
cuv:=0;
lung:=0;
while not eof(f) do
begin
read (f,x);
if ((x>='A') and (x<='Z')) or ((x>='a')and (x<='z')) then inc(lung);
end;
reset (f);
while not eof(f) do
begin
read (f,x);
if ((x>='A') and (x<='Z')) or ((x>='a')and (x<='z')) then write (g,x)
else writeln (g,' ');
end;
reset (g);
while not eof (g) do
begin
read (g,x);
if x<>' ' then inc(cuv);
readln(g);
end;
rewrite (g);
write (g,lung div cuv);
close (f);
close (g);
end.