Cod sursa(job #223751)

Utilizator nicastarRadu Moraru nicastar Data 29 noiembrie 2008 12:44:00
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.34 kb
Program Textul;
var f:text;
    i,j:integer;
    c:char;
    nl,nc,nmed:longint;
begin
nc:=1;
nl:=0;
assign(f, 'text.in');
reset(f);
while not eof(f) do
begin
  read(f, c);
  if c=' ' then nc:=nc+1
           else nl:=nl+1;
end;
nmed:=round(nl/nc);
close(f);
assign(f, 'text.out');
rewrite(f);
write(f, nmed);
close(f)
end.