Cod sursa(job #1089294)

Utilizator azkabancont-vechi azkaban Data 21 ianuarie 2014 17:03:16
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.6 kb
var c :char;
    k,l,i,j : longint;
begin
    assign(input,'text.in'); reset(input);
    assign(output,'text.out'); rewrite(output);
    i:=1;
while not eof(input) do begin
    read(c);
    j:=1;
    if (ord(c)>=65) and (ord(c)<=90) then l:=l+1;
    if (ord(c)>=97) and (ord(c)<=122) then l:=l+1;
    if c='-' then i:=i+1;
    if (c='-') and (i<>2) then k:=k+1;

    if (j=1) and (i=1) and (c<>' ') and (c<>'-') then k:=k+1;
    IF c=' ' THEN k:=k+1;
    if (c='.') or (c='!') or (c='?') then begin i:=1; j:=j+1; end;


                      end;




    writeln(l div k);
    close(input); close(output);
end.