Cod sursa(job #273460)

Utilizator andreirulzzzUPB-Hulea-Ionescu-Roman andreirulzzz Data 8 martie 2009 17:01:35
Problema Text Scor 70
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.75 kb
program texts;
var f:text;
    c:char;
    nrc,nrl,hold:longint;
    ok:boolean;
procedure scriere;
begin
      case c of
           'a'..'z': begin
                     inc(nrl);
                     ok:=true;
                     end;
           'A'..'Z': begin
                     inc(nrl);
                     ok:=true;
                     end;
           end;
      if not ok then inc(hold);
      if ok and (hold>0) then begin
         inc(nrc);
         hold:=0;
         end;
end;
begin
nrl:=0; nrc:=0;
assign(f,'text.in');
reset(f);
while not eof(f) do begin
      read(f,c);ok:=false;
      scriere;
      end;
close(f);
assign(f,'text.out');
rewrite(f);
if nrl<>0 then write(f,nrl div nrc)
else write(f,0);
close(f);
end.