Cod sursa(job #218796)

Utilizator squeezyAmza Bianca Ioana squeezy Data 3 noiembrie 2008 17:20:56
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.67 kb
var
f,g:text;
nrcuv,stot,i,j,nr:longint;
v:array[1..1000] of char;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
i:=1;
while not eof(f) do begin
    read(f,v[i]);
    inc(i);
    end;close(f);
nr:=i-1;  stot:=0;   nrcuv:=0;
for i:=1 to nr do
   if ((v[i]>='a') and (v[i]<='z')) or ((v[i]>='A') and (v[i]<='Z')) then
         inc(stot);         j:=1;
 while j<>nr-1  do
   if ((v[j]>='a') and (v[j]<='z')) or ((v[j]>='A') and (v[j]<='Z')) then
   inc(j) else
        if ((v[j+1]>='a') and (v[j+1]<='z')) or ((v[j+1]>='A') and (v[j+1]<='Z'))
   then begin inc(nrcuv); inc(j); end else inc(j);
write(g,trunc(stot/nrcuv+1));
close(g);
end.