Cod sursa(job #41818)

Utilizator savimSerban Andrei Stan savim Data 28 martie 2007 16:39:47
Problema Text Scor 80
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.46 kb
var f1,f2:text;
    lc,nc,i:longint;
    t,q:char;
begin
assign(f1,'text.in');
assign(f2,'text.out');
reset(f1);
rewrite(f2);
nc:=0;lc:=0;
read(f1,t);
while not eof(f1) do
 begin
  read(f1,q);
  if (((q>='a') and (q<='z')) or ((q>='A') and (q<='Z'))) and
     ((t<'A') or ((t>'Z') and (t<'a')) or (t>'z')) then nc:=nc+1;
  if ((q>='a') and (q<='z')) or ((q>='A') and (q<='Z')) then lc:=lc+1;
  t:=q;
 end;
writeln(f2,lc div nc);
close(f1);
close(f2);
end.