Cod sursa(job #135757)

Utilizator bishoppAlex Cristian bishopp Data 14 februarie 2008 14:09:58
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.67 kb
program texta;
var f,g:text;
    nrc,nrt:longint;
    ch:char;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
nrt:=0;
while not eof(f) do
      begin
      read(f,ch);
      if (ord(upcase(ch))>=65) and (ord(upcase(ch))<=90) then inc(nrt);
      end;
nrc:=0;
reset(f);
read(f,ch);
while not eof(f) do begin
      if (ord(upcase(ch))>=65) and (ord(upcase(ch))<=90) then begin
      while (ord(upcase(ch))>=65) and (ord(upcase(ch))<=90) do read(f,ch);
      inc(nrc);
      end
      else
      while ((ord(upcase(ch))<65) or (ord(upcase(ch))>90)) and not eof(f) do read(f,ch);
      end;
write(g,nrt div nrc);
close(f);
close(g);
end.