当前位置:网站首页>7-2 the cubic root of a number
7-2 the cubic root of a number
2022-06-26 13:23:00 【White -】
7-2 The third root of a number
Knowledge point : Two points
Given a floating-point number n, Find its third root .
Input format :
All in one line , Contains a floating-point number n(−10000≤n≤10000).
Output format :
All in one line , Contains a floating-point number , Represents the solution of the problem .
Be careful , The result is reserved 6 Decimal place .
sample input :
1000.00
sample output :
10.000000
Code :
#include<stdio.h>
#include<math.h>
double n;
int main()
{
///n(−10000≤n≤10000)
double l=-10000;
double r=10000;
scanf("%lf",&n);
while(r-l>=1e-8)
{
double mid=(l+r)/2;
if(pow(mid,3)>n)
r=mid;
else
l=mid;
}
printf("%.6lf",l);
}
202206260912 Japan
边栏推荐
- To solve the difficulties of small and medium-sized enterprises, Baidu AI Cloud makes an example
- ES中索引别名(alias)的到底有什么用
- H - Sumsets POJ 2229
- QT . Establishment and use of pri
- 5+api, clear application cache
- MySQL数据库讲解(三)
- Update and download of Beifu EtherCAT XML description file
- Detailed practical sharing, two hours of funny videos after work, earning more than 7000 a month
- Hdu1724[Simpson formula for integral]ellipse
- Processsing function random
猜你喜欢

Arcpy——InsertLayer()函数的使用:掺入图层到地图文档里

ES6 module

Processing function translate (mousex, mousey) learning

2、并行接口、协议和相关芯片介绍(8080、8060)

解中小企业之困,百度智能云打个样

Log in to the server using SSH key pair

【Spark】. Explanation of several icons of scala file in idea

计算两点之间的距离(二维、三维)

Electron official docs series: Processes in Electron

Beifu cx5130 card replacement and transfer of existing authorization files
随机推荐
Beifu PLC realizes zero point power-off hold of absolute value encoder -- use of bias
Composite mode
MariaDB study notes
Update and download of Beifu EtherCAT XML description file
KITTI Tracking dataset whose format is letf_ top_ right_ bottom to JDE normalied xc_ yc_ w_ h
Electron official docs series: Processes in Electron
7-2 picking peanuts
首批通过!百度智能云曦灵平台获信通院数字人能力评测权威认证
D - skiing
Opencv high speed download
Enjoy element mode (flyweight)
[how to connect the network] Chapter 1: the browser generates messages
Beifu cx5130 card replacement and transfer of existing authorization files
Nlp-d60-nlp competition D29
Hdu1724[Simpson formula for integral]ellipse
Basic configuration and test of Beifu twincat3 NCI in NC axis interface
F - Charm Bracelet
MongoDB系列之适用场景和不适用场景
Mysql database explanation (IV)
May product upgrade observation station