Cod sursa(job #1356748)

Utilizator Stefan.Andras Stefan Stefan. Data 23 februarie 2015 16:08:19
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.67 kb
program infoarena1;
var f,g:text;
    s:ansistring;
    i,litere,cuvinte:longint;
function litera:boolean;
begin
   litera:=((s[i] <= 'z') and (s[i] >= 'a')) or ((s[i] >= 'A') and (s[i] <= 'Z'))
end;
function cuvant:boolean;
begin
  cuvant:=NOT(((s[i-1] <= 'z') and (s[i-1] >= 'a')) or ((s[i-1] >= 'A') and (s[i-1] <= 'Z')))
end;
begin
   assign(f,'text.in'); reset(f);
   assign(g,'text.out'); rewrite(g);
   readln(f,s);  litere:=0; cuvinte:=0;
   for i:=2 to length(s) do
      begin
      if litera then
         inc(litere);
      if litera and cuvant then
         inc(cuvinte);
      end;
   writeln(g,litere div cuvinte);
   close(f); close(g);
end.