Circulation plays an important rule in gas exchange. Therefore, there is an interaction between circulation and gas exchange. To understand the dynamic effect of these two physiological systems, a computer simulation model of hemodynamics and gas exchange is established in this work. This model includes two physiological systems, namely the respiratory and circulatory systems. It consists of five parts: the model of gas transport, exchange and storage within the body, the multi-element nonlinear mathematical model of human circulatory system, an alveolar ventilation controller, a cardiac output controller, and a controller of breathing frequency. Model simulations provide results consistent with both dynamic and steady-state responses under hypoxia. Simulation results can reflect the interaction of hemodynamics and gas exchange. Using this model, the changes of pulmonary arterial pressure and right ventricular pressure in high altitude are studied. The optimal mode of breathing extra oxygen using nasal prongs or a facial mask is studied. This model may provide a useful tool to study reaction of hypoxia and the oxygen inhalation mode under hypoxia environments.