数学.sqrt(X)。以下是它的表格 math.sqrt(X)。以下是它的表格
public class SqRoots
{ static final int N = 10; // How many square roots to compute.
public static void main ( String [] args )
{
// Display a title
System.out.println( "\n Square Root Table" );
System.out.println( "-------------------" );
for ( int i = 1; i <= N; ++i ) // loop
{
// Compute and display square root of i
System.out.println( " " + i + ":\t" + Math.sqrt( i ) );
}
}
}