For vehicle adaptive cruise control (ACC) systems, the switching performance between throttle and brake determines the driving comfort, fuel consumption and service lives of vehicle mechanical components. In this paper, an ACC algorithm with the optimal switching control between throttle and brake is designed in model predictive control (MPC) framework. By introducing the binary integer variables, the dynamics of throttle and brake are integrated in one model expression for the controller design. Then the ACC algorithm is designed to satisfy not only safe car following, but also the optimal switching between throttle and brake, which leads to an online mixed integer quadratic programming solved by the nested two-loop method. The simulation results show that the proposed ACC algorithm meets the requirements of safe car following, outperforms the traditional algorithms by performing smoother responses, reducing the switching times between throttle and brake, and therefore improves driving comfort and fuel efficiency significantly.