Cod sursa(job #217205)

Utilizator squeezyAmza Bianca Ioana squeezy Data 27 octombrie 2008 17:46:50
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.65 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;         ok:=true;
while not eof(f) do begin
  read(f,v[i]);
 inc(i); end;   close(f);
 ct:=i;     stot:=0;        nrcuv:=0;
 for i:=2 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.