Cod sursa(job #223757)

Utilizator nicastarRadu Moraru nicastar Data 29 noiembrie 2008 12:56:10
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.63 kb
Program Textul;
var f:text;
    i,j:integer;
    c:char;
    nl,nc:longint;
    nmed:real;
    s:string;
begin
nc:=1;
nl:=0;
assign(f, 'text.in');
reset(f);
while not eof(f) do
begin
  read(f, c);
  if (c=' ') or (c=' ') then nc:=nc+1
                        else
                           if (c='!') or (c='?') or (c=':')
                                      or (c='.') or (c=',')
                                      or (c='-') then nl:=nl+0
                                                 else nl:=nl+1;
end;
nmed:=(nl/nc);
str(nmed, s);
close(f);
assign(f, 'text.out');
rewrite(f);
write(f, s[2]);
close(f)
end.