Skip to content
小飞侠
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
菜单

博客

  1. 首页>
  2. 其他>
  3. 求一个数的算术平方根

求一个数的算术平方根

  • Post author:xfxia
  • Post published:2023年12月25日
  • Post category:其他


写一段程序求出一个数的算术平方根:

#include<iostream>
using namespace std;
#define e 0.001
double sqrt(double a)
{
		double x,y;
		x=a/2;
		y=x+1+e;
		while(x-y>e||y-x>e)
		{
				y=x;
				x=(x+a/x)/2;
		}
		return x;
}
int main()
{
		double a;
		cin>>a;
		cout<<sqrt(a);
		return 0;
}


你可能也喜欢

为什么使用ReLU而不是sigmoid

61-Mybatis介绍

深度学习–简述卷积层如何检测物体边缘原理

操作系统实验——模拟实现动态分区管理

手机工厂测试

css垂直居中总结

DHCP服务的搭建

怎么卸载_怎么卸载找不到程序的流氓软件?

使用list.parallelStream().forEach()查询数据或插入数据遇到的问题看这里

jupyter lab 导入statsmodels

Dubbo-服务调用路由规则

推导强化学习bellman方程(正着推)

VS构建多模块的Cmake项目+引入外部dll

RGBD-SLAM总结

X window selection — xclip

echarts tree默认展开_Echarts树形图展开和收缩

Flume速览

2022年9月1日:Visual Studio Code 中的 GitHub 简介(未做完)

.Net MVC4 使用心得(六)WebApi Json和Xml,razor@{}

服务器基础命令

目录

  • APICloud (3)
  • golang (228)
  • java (8,236)
  • linux (4,002)
  • mysql (2,800)
  • php (1,070)
  • python (5,439)
  • solidity (25)
  • uniapp (235)
  • vue (2,463)
  • 其他 (88,233)
  • 小程序 (801)

文章归档

  • 2023年十二月 (1872)
  • 2023年十一月 (477)
  • 2023年十月 (17371)
  • 2023年九月 (44974)
  • 2023年八月 (26399)
  • 2023年七月 (14793)
  • 2023年六月 (1)
  • 2023年五月 (2186)
  • 2023年四月 (3838)
  • 2023年三月 (1544)
  • 2023年二月 (3)
  • 2023年一月 (4)
  • 2022年十二月 (3)
  • 2022年十一月 (36)
  • 2022年十月 (16)
  • 2022年九月 (8)
  • 2021年九月 (1)
  • 2020年九月 (6)
  • 2020年八月 (5)

标签

Aave (1) cosmos (6) defi (255) flag (27) gitee (1) github (1) golang (234) java (8234) linux命令 (82) List (1) map (1115) mysql (3093) npm (237) tendermint (6) uuid (43) vant (64) vmware (270) 区块链 (63) 合约 (37) 小程序版本更新 (3)
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
Copyright xfxia.com 鲁ICP备19024253号-2
关闭菜单