Cod sursa(job #1376941)

Utilizator Stefan.Andras Stefan Stefan. Data 5 martie 2015 19:26:46
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.79 kb
program infoarena1;
var f,g:text;
    c:char;
    litere,cuvinte,i:longint;
    s:string;
    bufin,bufout:array[1..66000] of byte;
    str:ansistring;
begin
   assign(f,'text.in'); reset(f);
   assign(g,'text.out'); rewrite(g);
   settextbuf(f,bufin);
   settextbuf(g,bufout);
   litere:=0; cuvinte:=0;
   s:='QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm';
   readln(f,str);
 //  while not seekeof(f) do
   i:=1;
   while i <= length(str) do
      begin
     // read(f,c);
      if pos(str[i],s) > 0  then
         begin
         inc(cuvinte);
         while pos(str[i],s) > 0 do
            begin
            inc(litere);
            inc(i);
            end;
         end;
      inc(i);
      end;
   writeln(g,litere div cuvinte);
   close(f); close(g);
end.