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 ...
随机推荐
- 明解C语言 中级篇 第一章答案
练习1-1 #include <stdio.h> #include<stdlib.h> int main() { srand(time()); ; printf("您 ...
- background属性怎么添加2个或多个背景图
最近遇到一个需求,下面充值金额按钮是一个背景图,点击之后显示的状态也是一个背景图,如下图 按照惯用的套路,新增一个class,点击后的状态直接写在里面即可 然而点击后,虽然状态背景成功显示出 ...
- 【MySQL】对数据库和表的增删改查
数据库的基本概念 数据库的英文单词: DataBase 简称 : DB 什么是数据库? 用于存储和管理数据的仓库. 数据库的特点: 持久化存储数据的.其实数据库就是一个文件系统 方便存储和管理数据 使 ...
- 春秋-SQLi题
这道题挺好的 学到的知识 sprintf()构成的sql注入漏洞 题目环境今天做的时候坏了 留下这几篇博客学习 https://blog.csdn.net/nzjdsds/article/detail ...
- Django 使用 cookie 实现简单的用户管理
Cookie: 1.保存在用户浏览器 2.可以主动清除 3.可以被伪造 4.跨域名 Cookie 不共享 创建一个项目:user_manager 和应用: app01 创建数据库,添加 models. ...
- java基础类型的byte为长度
java基础类型的字节长度: 类型 byte数/位数 最大/最小值 byte 1/8 127/-128 short 2/16 32767/-32768 int 4/32 2147483647/-214 ...
- MongoDB 4.X 用户和角色权限管理总结
关于MongoDB的用户和角色权限的梳理一直不太清晰,仔细阅读了下官方文档,并对此做个总结. 默认情况下,MongoDB实例启动运行时是没有启用用户访问权限控制的,也就是说,在实例本机服务器上都可以随 ...
- Shel脚本-初步入门之《05》
Shel脚本-初步入门-05 常用操作系统默认的 Shell 5.常用操作系统默认的 Shell 通过以下两种方法可以查看 CentOS Linux 系统默认的 Shell 方法1: echo $SH ...
- 10wx.showToast消息提示框 wx.showModal模态对话框
1==>wx.showToast 弹出层 在界面交互中 显示消息提示框 它是一个消失提示框 提示用户成功 或者失败等消息 <button size='mini' bindtap='hanl ...
- 2018710101021-王方-《面向对象(java)程序设计》第十一周学习总结
项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...