当前位置:网站首页>7-2 数的三次方根
7-2 数的三次方根
2022-06-26 12:32:00 【白—】
7-2 数的三次方根
知识点:二分
给定一个浮点数 n,求它的三次方根。
输入格式:
共一行,包含一个浮点数 n(−10000≤n≤10000)。
输出格式:
共一行,包含一个浮点数,表示问题的解。
注意,结果保留 6 位小数。
输入样例:
1000.00
输出样例:
10.000000
代码:
#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日
边栏推荐
- The most complete kubernetes core command of the latest version so far
- Build Pikachu shooting range and introduction
- PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)
- Assembly language (7) operation instruction
- TP5 thinkphp5 extension package think Mongo operation mongodb time interval range query
- What should I do from member labels to portraits?
- Common problems and Thoughts on member operation management
- AD - 将修改后的 PCB 封装更新到当前 PCB 中
- HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 3 freertos-mpu protection bypass
- Fengshentai old shooting range Kali series
猜你喜欢

2021 q3-q4 investigation report on the use status of kotlin multiplatform

JMeter response time and TPS listener tutorial

Microservice governance (nocas)

Fengshentai old shooting range Kali series

HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过

dried food! Yiwen will show you SD card, TF card and SIM card!

PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)

【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构

International beauty industry giants bet on China

HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 2 MPU based IOT device attack mitigation technology
随机推荐
证券账户可以开通 开户安全吗
International beauty industry giants bet on China
Analysis report on dynamic research and investment planning suggestions of China's laser medical market in 2022
Deep thinking from senior member managers
房租是由什么决定的
VMware virtual machine bridging mode can not access the campus network "suggestions collection"
Pratique de l'attaque et de la défense du réseau HUST | 6 Expérience de sécurité du microprogramme de l'équipement IOT | expérience 2 technologie d'atténuation des attaques de l'équipement IOT basée s
JS how to judge when data contains integer and floating-point types. Floating-point decimals retain two digits after the decimal point
做自媒体视频的各种常用工具合集奉上
New routing file in laravel framework
MOS管基本原理,单片机重要知识点
Consumer goods enterprises, four pain points of member marketing
一个初级多线程服务器模型
Scala problem solving the problem of slow SBT Download
I want to know whether flush is a stock market? Is online account opening safe?
初探Protostuff的使用[通俗易懂]
NFS shared storage service installation
The loss of female scientists
Analysis report on China's photovoltaic inverter market prospect forecast and investment strategy recommendations in 2022
7-16 货币系统Ⅰ