C++primer plus第六版课后编程题答案7.1

7.1


#include<iostream>

using namespace std;
double tiaohe(double ,double );
void main71()
{

	double a,b;
	cout<<"Plesase enter 2 number :";
	cin>>a;
	cin>>b;
	if(a==0||b==0)
		cout<<"\nWrong input"<<endl;
	else
		cout<<"tiaohe is "<<tiaohe(a,b)<<endl;

	system("pause");



}

double tiaohe(double a,double b)
{
	return 2.0*a*b/(a+b);

}


posted @ 2014-03-31 21:12  天下纵横C++  阅读(150)  评论(0)    收藏  举报