Cod sursa(job #135953)

Utilizator TudorutzuMusoiu Tudor Tudorutzu Data 14 februarie 2008 21:32:29
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.53 kb
const litere=['a'..'z','A'..'Z'];
var f,g:text;
    x,y:char;
    nrl,nrc:longint;
begin
     assign(f,'text.in'); reset(f);
     assign(g,'text.out'); rewrite(g);
     while not eof(f) do
     begin
          while not eoln(f) do
          begin
               y:=x;
               read(f,x);
               if x in litere then inc(nrl)
                              else if y in litere then inc(nrc);
          end;
          readln(f);
          inc(nrc);
     end;
     writeln(g,trunc(nrl/nrc));
     close(g);
end.