Cod sursa(job #248106)

Utilizator CristianfStanciulescu Cristian-Florinel Cristianf Data 24 ianuarie 2009 21:26:15
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.41 kb
type Multime = set of char;
var m:multime;
    c:char;
    f,g:text;
    c1,c2,c3:integer;
begin
assign(f,'text.in');
reset(f);
m:=['a'..'z']+['A'..'Z'];
c1:=0;
c2:=1;
while not eof(f) do
while not eoln(f) do
  begin
  read(f,c);
if c in m then
 inc(c1);
if (c=' ') or (c='-') then
       inc(c2);
end;
Close(f);
c3:=c1 div c2;
assign(g,'text.out');
rewrite(g);
writeln(g,c3);
Close(g);
end.