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;
}


你可能也喜欢

html 按钮旋转

ExtJS4组件_button按钮配置-属性-方法详解

android studio clang++: error: no such file or directory: ‘x86‘

Android Lmkd 低内存终止守护程序

路行助手无法使用_路行助手登录企业微信为什么一直登录不上?

剑指:二叉树有关题目

c++ leetcode 三数之和

史上最全C++ S3 SDK使用流程梳理

乐观锁和悲观锁的区别

SpringBoot参数校验以及分组校验的使用

window下Nginx启动bat脚本

Zookeeper使用

putty连接时出现software caused connection abort

ising模型

Navicat 快速生成数据字典

【DDD】领域驱动设计是什么?

IDEA设置保存自动删除没用的import代码

Collections.synchronizedList实现ArrayList线程安全原理

U盘安装CentOS7时报错:Warning: dracut-initqueue timeout – starting timeout scripts

国家省市支持多选查询动态sql

目录

  • 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
关闭菜单