计算调和平均数
来源:互联网 发布:树莓派gpio编程c语言 编辑:程序博客网 时间:2024/04/28 07:35
#include<iostream>
using namespace std;
double subdivide(const double x,const double y);
int main(void)
{
using namespace std;
double x, y;
cout << "Enter two numbers:";
while (cin >> x >> y && x&&y)
{
cout << "average = :" << subdivide(x, y) << endl;
cout << "Enter two numbers:";
}
cout << "ERROY!";
cin.get();
cin.get();
return 0;
}
double subdivide(const double x, const double y)
{
return 2.0*x*y / (x + y);
}
using namespace std;
double subdivide(const double x,const double y);
int main(void)
{
using namespace std;
double x, y;
cout << "Enter two numbers:";
while (cin >> x >> y && x&&y)
{
cout << "average = :" << subdivide(x, y) << endl;
cout << "Enter two numbers:";
}
cout << "ERROY!";
cin.get();
cin.get();
return 0;
}
double subdivide(const double x, const double y)
{
return 2.0*x*y / (x + y);
}
0 0
- 计算调和平均数
- 函数使用:调和平均数
- 准确率 召回率 调和平均数等
- 1098 -- 计算平均数
- 1275:计算平均数
- 平均数的计算
- 31.计算数组平均数,并输出平均数和小于平均数且最接近平均数的数
- perl 计算平均数的方法
- python的算数平均数计算
- c++ primer plus 第七章《编程题7.13.1-求两个数的调和平均数》
- 平均数
- 平均数
- 平均数
- 平均数
- 平均数
- 输入几个数,计算其平均数。
- 5-1-1 初试数组-计算平均数并输出所有大于平均数的数-关于平均数的double-安全隐患
- 计算输入的数字的平均数,并输出大于平均数的数字
- hibernate缓存配置
- linux 修改系统默认编码
- POJ 2167 Irrelevant Elements
- Linux使用Shell脚本实现ftp的自动上传下载
- iOS 常遇问题与解决
- 计算调和平均数
- C++ 调用 Java 返回String类型
- JAVA 基础知识
- iOS 从各种效果图颜色标注生成 UIColor
- Mac下android studio 安装Genymotion插件找不到地址错误
- Writing an Hadoop MapReduce Program in Python
- 微信中长按弹出菜单(1) 没有实现功能
- Spring整合Hibernate管理事务(xml配置方式)
- NSNumber的使用