Cod sursa(job #1039174)

Utilizator DjokValeriu Motroi Djok Data 22 noiembrie 2013 17:21:30
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 1.06 kb
var s:ansistring;
    i, l, c:longint;
begin
assign(input,'text.in');
assign(output,'text.out');
reset(input);
rewrite(output);
  readln(s); l:=0; c:=0;
   for i:=1 to length(s) do
    case s[i] of
     'a'..'z': inc(l);
     'A'..'Z': inc(l);
    end; i:=1;
     while i<=length(s) do
      begin
       if ((ord(s[i])>=65) and (ord(s[i])<=90)) or ((ord(s[i])<=122) and (ord(s[i])>=45)) or (ord(s[i])=45) then inc(i)
                                                                                                          else
                                                                                                           begin
                                                                                                            inc(i);
                                                                                                            inc(c);
                                                                                                           end;

       end;
      writeln(l div c);

close(input);
close(output);
end.