1021: [编程入门]迭代法求平方根(C语言) 摘要:题目:用迭代法求 平方根公式:求a的平方根的迭代公式为: X[n+1]=(X[n]+a/X[n])/2 要求前后两次求出的差的绝对值少于0.00001。 输出保留3位小数解题思路:输入x,求出x的平方…… 题解列表 2022年11月03日 0 点赞 0 评论 523 浏览 评分:9.9
[编程入门]如何使用迭代公式?--教你一文看懂。 摘要:解题思路: 很多人不会写其实是不知道公式怎么用,这边解释一下题目就简单了。 &n 题解列表 2022年12月12日 0 点赞 0 评论 810 浏览 评分:9.9
最简约易懂求平方根 摘要:解题思路:一直迭代注意事项:迭代参考代码:a=float(input())x1=a/2x2=(x1+a/x1)/2while abs(x1-x2)>0.00001: x1=x2 x2=(x…… 题解列表 2023年01月11日 1 点赞 0 评论 648 浏览 评分:9.9
LikeWater - 1021: [编程入门]迭代法求平方根 摘要:####其实对于正确率大于50%的题目我都不太想写题解,因为感觉大家都会的话写题解没必要,对于小于50%的题目我倒是更乐意写题解,还能拿经验值。 ```cpp #include #inclu…… 题解列表 2023年02月26日 0 点赞 1 评论 178 浏览 评分:9.9
想看奥本海默 摘要:#include<iostream>#include<cmath>using namespace std;int main(void){ float x,x1=1.00; float a;…… 题解列表 2023年07月23日 0 点赞 0 评论 191 浏览 评分:9.9
迭代法求平方根,逐句讲解 摘要:参考代码:#include <stdio.h>#include <math.h>// 定义一个宏,用于计算两个数之间的差的绝对值#define ABS(x) ((x) > 0 ? (x) : -(x)…… 题解列表 2023年08月19日 0 点赞 0 评论 218 浏览 评分:9.9
[编程入门]迭代法求平方根 (C语言) 摘要:解题思路:这个比较思路比较浅显,就是让该公式进行多次的计算,然后不断逼近结果。注意事项:最后记得绝对值输出参考代码:#include<stdio.h>#include<math.h>int main(…… 题解列表 2023年11月13日 0 点赞 0 评论 296 浏览 评分:9.9
C语言递归法解决迭代法 摘要:解题思路:C语言递归法解决迭代法 注意事项:X[n+1]=(X[n]+a/X[n])/2 ;注意递归的限制条件为X[n]-X[n+1]小于0.00001,故应在函数的开始时先计算出新的X[n…… 题解列表 2023年11月23日 0 点赞 0 评论 157 浏览 评分:9.9
1021: [编程入门]迭代法求平方根(最简单的!!!) 摘要:##思路 直接`sqrt`即可。 ##代码 ```cpp #include using namespace std; int main(){ int a,b; cin>>a; …… 题解列表 2024年02月07日 0 点赞 0 评论 344 浏览 评分:9.9
1021: [编程入门]迭代法求平方根 海事守门鼠 摘要:迭代法求平方根 ```c #include #include int main() { double x, y, a; scanf("%lf", &a); …… 题解列表 2024年03月09日 0 点赞 0 评论 222 浏览 评分:9.9