Cod sursa(job #217202)

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