Cod sursa(job #38361)

Utilizator taloibogdanTaloi Bogdan Cristian taloibogdan Data 25 martie 2007 18:24:53
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
Program textul;
Var alfabet:set of char;
    f:text;
    c,nc:longint;
    s,ss:char;
Begin
  alfabet:=['a'..'z','A'..'Z'];
  assign(f,'text.in');
  reset(f);
  c:=0;
  nc:=0;
  s:='=';
  repeat
   ss:=s;
   read(f,s);
   if s in alfabet then c:=c+1;
   if ss<>'=' then if (not(s in alfabet)) and (ss in alfabet) then nc:=nc+1;
  until(eoln(f));
  close(f);
  if s in alfabet then nc:=nc+1;
  Writeln(c div nc);
  Writeln;
End.