Forced quasiperiodic and almost periodic solution for nonlinear systems