Pagini recente » Cod sursa (job #399967) | Cod sursa (job #56588) | Cod sursa (job #1939395) | Cod sursa (job #117452) | Cod sursa (job #368452)
Cod sursa(job #368452)
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
begin
if (o)and((a in['~','!','{','@','#','$','%','^','&','(',')','-','}',' '])or(a in ['0'..'9'])) then
begin
nrc:=nrc+1;
o:=false;
end;
if (o)and(a in['|','"',':','+','?','=','<','>','.',',','/',';','[',']','\'])then
begin
nrc:=nrc+1;
o:=false;
end;
end;
until eoln(f);
readln(f);
until eof(f);
writeln(g,nrl div (nrc+1));
close(f);
close(g);
end.