Func sqrt( num )
N = 0;
IF ( EQ(num, N)) to Endit;
N = num / 2.2 + 1;
N1 = (N + (num/N)) / 2;
Again: IF ( GE(N1, N)) to Endit;
N = N1;
N1 = (N + (num/N)) / 2;
IF ( TRUE ) to Again;
Endit: sqrt = N;
Endfunc
Func main()
Write( "Enter a number: " );
Read ( X );
S = sqrt( X );
Write ( "The square root is:");
Write ( S );
Endfunc
目前暂无任何回答
- 0 回答
- 0 关注
- 690 浏览
添加回答
举报
0/150
提交
取消