Cod sursa(job #44969)

Utilizator adrianraduleaRadulea Adrian adrianradulea Data 31 martie 2007 21:16:47
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.58 kb
var a:array[1..256] of char;
    n,cuvinte:byte;
    c1,c2:char;
    f,g:text;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
n:=0;
cuvinte:=0;
while not eof(f) do begin
c1:=chr(10);
while not eoln(f) do begin
  read(f,c2);
  if (((65<=ord(c2)) and (ord(c2)<=90)) or ((ord(c2)>=97) and (ord(c2)<=122))) then inc(n);
  if ((ord(c1)>122) or (ord(c1)<65) or ((ord(c1)<97) and (ord(c1)>90))) and (((65<=ord(c2)) and (ord(c2)<=90))
or ((ord(c2)>=97) and (ord(c2)<=122))) then inc(cuvinte);
  c1:=c2;
end;
end;
write(g,trunc(n/cuvinte));
close(g);
end.