Cod sursa(job #306827)

Utilizator al3csutzuSirbu Alexandru al3csutzu Data 21 aprilie 2009 23:20:08
Problema Text Scor 80
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.73 kb
  program texte;   
  var f,g:text;   
  s,prec,l:string[1];   
  litere:string;   
  k,lit,cuv:longint;   
  begin  
  assign(f,'text.in'); assign(g,'text.out');   
  reset(f); rewrite(g);   
  s[1]:=' '; prec[1]:=' ';   
  lit:=0; cuv:=0;   
  litere:='qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM';   
  while not eof(f) do  
  begin  
    read(f,s[1]);   
    if pos(s[1],litere)<>0 then  
      begin  
       lit:=lit+1;   
       if pos(prec[1],litere)=0 then cuv:=cuv+1;   
      end;   
    if (eoln(f)) and not (eof(F))then l[1]:=s[1];   
    prec[1]:=s[1];   
  end;   
//  if (pos(l[1],litere)<>0) and (pos(prec[1],litere)=0) then cuv:=cuv+1;   
  writeln(g,lit/cuv:0:0);   
  close(f); close(g);   
end.