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
慕斯4360584
慕慕5436299