find square root
public class Solution {
public static void main(String[] args) {
Scanner ip = new Scanner(System.in);
System.out.print("Enter a number: ");
double n = ip.nextDouble();
System.out.println(sqrt(n));
ip.close();
}
public static double sqrt(double number) {
double t;
double squareRoot = number / ;
do {
t = squareRoot;
squareRoot = (t + (number / t)) / ;
} while ((t - squareRoot) != );
return squareRoot;
}
}
find square root的更多相关文章
- Codeforces 715A. Plus and Square Root[数学构造]
A. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Project Euler 80:Square root digital expansion 平方根数字展开
Square root digital expansion It is well known that if the square root of a natural number is not an ...
- Codeforces 612E - Square Root of Permutation
E. Square Root of Permutation A permutation of length n is an array containing each integer from 1 t ...
- Codeforces 715A & 716C Plus and Square Root【数学规律】 (Codeforces Round #372 (Div. 2))
C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- (Problem 57)Square root convergents
It is possible to show that the square root of two can be expressed as an infinite continued fractio ...
- Square Root
Square RootWhen the square root functional configuration is selected, a simplified CORDIC algorithm ...
- Codeforces Round #372 (Div. 1) A. Plus and Square Root 数学题
A. Plus and Square Root 题目连接: http://codeforces.com/contest/715/problem/A Description ZS the Coder i ...
- Plus and Square Root
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ...
- CodeChef - SQRGOOD:Simplify the Square Root (求第N个含平方因子数)
Tiny Wong the chef used to be a mathematics teacher in a senior high school. At that time, he always ...
- Project Euler 57: Square root convergents
五十七.平方根收敛(Square root convergents) 二的平方根可以表示为以下这个无穷连分数: \[ \sqrt 2 =1+ \frac 1 {2+ \frac 1 {2 +\frac ...
随机推荐
- Date以及LocalDateTime格式化
public static void main(String[] args) { LocalDateTime local = LocalDateTime.now(); Date date = new ...
- Python term 模块
Python term 模块 term 模块适用于文字编辑,样式切换,光标移动 等一系列操作适用于终端命令行文字光标处理等操作. 安装 pip install py-term 使用方式 方式一 imp ...
- 【UOJ#22】【UR #1】外星人(动态规划)
[UOJ#22][UR #1]外星人(动态规划) 题面 UOJ 题解 一道简单题? 不难发现只有按照从大往小排序的顺序选择的才有意义,否则先选择一个小数再去模一个大数是没有意义的. 设\(f[i][j ...
- AdminLTE 3.0发布了
在11月2日,作者正式发布了AdminLTE 3.0版本.该版本基于Bootstrap 4.x.使用Bootstrap 4.x的小伙伴可以愉快的使用AdminLTE. Github AdminLTE是 ...
- Linux中用postfix搭建邮件服务器实战详解
Linux中用postfix搭建邮件服务器实战详解 postfix是Wietse Venema在IBM的GPL协议之下开发的MTA(邮件传输代理)软件.Postfix试图更快.更容易管理.更安全,同时 ...
- swift(三)字典数组操作
//1.数组的概念和定义 var array = [,,,] var array1:Array = [,,,] var array2:Array<Int> = [,,,]; var arr ...
- IEDA创建Springboot项目
随着技术的更新对于开发速度的追求,我们越来越不能忍受的是Spring框架对于集成开发以后大量的配置问题.所以SprigBoot应运而生,SpringBoot框架其实就是在Spring框架的外边包裹上了 ...
- 微信公众号token验证失败
我用的是python3+,而官网给的例子是python2的写法.问题就在python版本不同. 下面是截取官方的实例代码的一部分 list = [token, timestamp, nonce] li ...
- shell 之while两种写法
1.while[] #!/bin/dash min= max= while [ $min -le $max ] do echo $min min=`` done 2. while(()) #!/bin ...
- WIN10安装64位JDK10.0.2详细完整教程(图文)
1.下载JDK 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 1)如下图,点击红色箭头处: 2)如下图 ...