Cod sursa(job #284612)

Utilizator frozen62iceBLue FirE frozen62ice Data 21 martie 2009 20:33:25
Problema Text Scor 10
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.51 kb
var f,g:text;
    ok1,ok2:boolean;
    x:char;
    numar_litere,numar_cuvinte:longint;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
numar_cuvinte:=0;
numar_litere:=0;
while not eof(f) do begin
 ok1:=false;
 ok2:=false;
 while not eoln(f) do begin
  read(f,x);
  if x in ['a'..'z','A'..'Z'] then ok2:=true;
  if not ok1 and ok2 then inc(numar_cuvinte);
  if ok2 then inc(numar_litere);
 end;
 readln(f);
end;
writeln(g,numar_litere div numar_cuvinte);
close(f);
close(g);
end.