Pagini recente » Cod sursa (job #301421) | Cod sursa (job #1382850) | Cod sursa (job #1544627) | Cod sursa (job #94216) | Cod sursa (job #368437)
Cod sursa(job #368437)
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
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='*')or(a='/')) then
begin
nrc:=nrc+1;
o:=false;
end;
until eof(f);
writeln(g,trunc(nrl/(nrc+1)));
close(f);
close(g);
end.