求长方形和圆形面积
import java。util。*;
public class CalculateArea
{
static final double PI = 3。 1415926;
public static void main(String[] args)
{
double radius = 0, length = 0,width = 0;
Scanner in = new Scanner ( );
intln("please input the radius of the circle");
radius = xtDouble();
intln("The area of the circ...全部
import java。util。*;
public class CalculateArea
{
static final double PI = 3。
1415926;
public static void main(String[] args)
{
double radius = 0, length = 0,width = 0;
Scanner in = new Scanner ( );
intln("please input the radius of the circle");
radius = xtDouble();
intln("The area of the circle is " + PI * radius * radius);
intln("please input the length of the rectangle");
length = xtDouble();
intln("please input the width of the rectangle");
width = xtDouble();
intln("The area of the rectangle is " + length * width);
}
}。收起