Pagini recente » Cod sursa (job #132331) | Cod sursa (job #905079) | Cod sursa (job #1848540) | Cod sursa (job #420856) | Cod sursa (job #368445)
Cod sursa(job #368445)
program litere;
uses crt;
var a:char;
nrl,i:longint;
nrc:word;
f,g:text;
o:boolean;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
nrc:=0;
nrl:=0;
o:=false;
repeat
repeat
read(f,a);
if (a in ['A'..'Z'])or(a in['a'..'z'])then
begin
nrl:=nrl+1;
o:=true;
end
else
if (o)and((a=' ')or(a='-')or(a='+')or(a='*')) then
begin
nrc:=nrc+1;
o:=false;
end;
until eoln(f);
readln(f);
until eof(f);
writeln(g,nrl div (nrc+1));
close(f);
close(g);
end.