当前位置:网站首页>[Code Hoof Set Novice Village 600 Questions] Find the square root of the given data
[Code Hoof Set Novice Village 600 Questions] Find the square root of the given data
2022-07-29 18:33:00 【Sandm*】
Title link:
Code Foot Collection (matiji.net)
Things to solve the problem:
- The floor(x) function in the title refers to rounding down,
is the largest integer not greater than x
So there is no need to judge whether the input data is a perfect square number,
Because even if it's not a perfect square,
The result of the final floor (x) rounded down is the same
Note:
The return type of floor(x) is double
- sqrt() function is C, C++ specially used to find the square root of a number
Reference code:
#includeusing namespace std;int main( ){int data = 0;cin >> data;printf("%d",(int)floor(sqrt(data)));return 0;} 边栏推荐
猜你喜欢
随机推荐
泰山OFFICE技术讲座:影响文字效果的因素,由四大升级为五大
「硬核」labelme 图片中显示标签
浅析无人机发展趋势以及如何实现EasyDSS+无人机视频推流?
浅谈智能家居应用及传输方式
Batch_Normalization 、Layer_Normalization 、Group_Normalization你分的清楚吗
Virtink:更轻量的 Kubernetes 原生虚拟化管理引擎
地球超2亿蛋白质结构全预测,AlphaFold引爆「蛋白质全宇宙」
“我“眼中的测试/开发程序员,预想与现实的碰撞......
2022 年 WebAssembly 应用现状
刚刚,60后复旦校友IPO敲钟:市值400亿
How different DAOs are changing the world
JupyterNotebook安装插件管理包过程中报错( AttributeError module ‘tornado.web‘ has no attribute ‘asynchronous‘ )
Route ISIS
牛血清白蛋白-葡聚糖纳米颗粒包埋蛋清源活性肽/葡聚糖共价接枝物的制备
【Mysql系列】01_查询+排序
IDEA远程调试
【南瓜书ML】(task5)支持向量机的数学推导(更新ing)
ng组件注册及使用
NFTScan and PANews jointly release multi-chain NFT data analysis report
Piotr`s Ants









