Cod sursa(job #17642)

Utilizator h_istvanHevele Istvan h_istvan Data 16 februarie 2007 15:38:59
Problema Text Scor 80
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.64 kb
{$A+,B-,D+,E+,F-,G-,I-,L+,N-,O-,P-,Q-,R-,S-,T-,V+,X+}
{$M 16384,0,655360}

program text1;
const betu : set of char = ['a'..'z','A'..'Z'];
var c:char;
    n,h:longint;
    f:text;

begin
     assign(f,'text.in');
     reset(f);

     n:=0;h:=0;

     while(not eof(f)) do
     begin
          read(f,c);
          while(not (c in betu)) and (not eof(f)) do read(f,c);
          while(c in betu) and (not eof(f)) do
          begin
               inc(h);
               read(f,c);
          end;
          inc(n);
     end;
     close(f);
     assign(f,'text.out');
     rewrite(f);
     write(f,h div n);
     close(f);
end.