> 其他 >
求C语大神,用迭代法求某数a的平方根,已知迭代公式为x1=1/2(x0+a/x0)
用for语句编写程序
人气:115 ℃ 时间:2020-05-23 00:53:13
解答
#include"stdio.h"#include"math.h"void main(){float a,x0,x1; printf("Input a:"); scanf("%f",&a); if(a<0) printf("Error!\n{...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版