Nonhomogeneous systems involving critical or subcritical nonlinearities