Cod sursa(job #418240)

Utilizator axel15dobre alex axel15 Data 15 martie 2010 18:13:05
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.49 kb
var  a:char;
     nr,cont,m:longint;
     f,g:text;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
while not eoln(f) do begin
 read(f,a);
 if (upcase(a)>='A') and(upcase(a)<='Z') then nr:=nr+1
                                         else

                  if (nr<>0)  then
                     if (ord(a)=32) or (ord(a)=44) or (a='-') or (a='!') or (a='?') or (a='.') then cont:=cont+1;

end;
m:=(nr div cont);
writeln(g,m);
close(f);
close(g);
end.