Cod sursa(job #551095)

Utilizator vladch93Vlad Chereches vladch93 Data 10 martie 2011 12:44:12
Problema Text Scor 60
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.57 kb
program tttt;
var f : text;
    x, y : char;
    k, l : integer;
begin
assign (f, 'text.in');
reset (f);
l:=0;
k:=0;
y:=' ';
repeat
 read (f, x);
 while upcase(x) in ['A'..'Z'] do begin
                                   y:=x;
                                   inc (l);
                                   read (f, x);
                                  end;
 if (x in [' ', '-', '.', ',', ':', ';', '!', '?']) and (upcase (y) in ['A'..'Z']) then inc (k);
 y:=x;
until eof(f);
close (f);
assign (f, 'text.out');
rewrite (f);
write (f, l div k);
close (f);
end.