Cod sursa(job #601320)

Utilizator ion824Ion Ureche ion824 Data 5 iulie 2011 21:53:19
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.58 kb
Program texte;
   var litere,simboluri:set of char;
       ch:char;
       suma,cuvinte:longint;
       f:text;
begin
  assign(f,'text.in'); reset(F); read(f,ch); litere:=['a'..'z','A'..'Z']; simboluri:=[chr(32)..chr(126)]-litere; suma:=0; cuvinte:=0;
  while not eof(f) do  begin
     while not eoln(f) do begin
       while ch in simboluri do read(f,ch);
       if ch in litere then inc(cuvinte);
       while ch in litere do begin inc(suma); read(f,ch);  end; end; readln(f); end;
    close(f); assign(f,'text.out'); rewrite(f); writeln(f,suma div cuvinte); close(f); end.