Cod sursa(job #248128)

Utilizator dyzzy_dyzzyStanciulescu Daniel dyzzy_dyzzy Data 24 ianuarie 2009 22:07:26
Problema Text Scor 50
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.56 kb
type Multime = set of char;
var m,m2:multime;
    c:char;
    f,g:text;
    c1,c2,c3,r:integer;
    ok:boolean;
begin
assign(f,'text.in');
reset(f);
m:=['a'..'z']+['A'..'Z'];
m2:=['0'..'9'];
c1:=0;
c2:=1;
ok:=false;
while not eof(f) do
  begin
  read(f,c);
if c in m then
 inc(c1);
if (c=' ') or (c='-') then
       begin
       inc(c2);
       ok:=true;
       end;
if (c in ['0'..'9']) and (ok) then
   begin
   dec(c2);
   ok:=false;
   end;


end;
Close(f);
assign(g,'text.out');
rewrite(g);
writeln(g,c1 div c2);
Close(g);
end.