6ix.cpp

来自「C/C++程序设计导论(第二版)》程序源文件」· C++ 代码 · 共 28 行

CPP
28
字号
// Drugdose.cpp  Generate a recommended and actual drug
//	dose for study patients.

#include <iostream.h>
#include "drugcalc.h"
const int NUMPATS = 100;

void main()
{	int count=0;					// counter for patients.
	float recommend;					// recommended and actual
	int actual; 					// drug doses.
	char sex;					// patient gender,
	float weight;					// patient weight, and
	int age;					// patient age.

	cout << "Patient Drug Dose Report" << endl;
	cout << " Sex	     Age	     Weight     Dose     Pill" << endl;

	while (count < NUMPATS)
	{	ReadPatient (sex, age, weight);
		recommend = RecomDose (sex, weight);
		actual = ActualDose (recommend);
		cout << sex << "   " << age << "   " << weight << "   " <<
			recommend << "   " << actual << endl;
		count = count + 1;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?