求长方形和圆形面积
实现一个程序(JAVA),能够从屏幕接收输入,作为长方形的边 和圆形的半径,求长方形和圆形面积
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); } }。
问:12周长相等的等边三角形,正方形,圆形,长方形,哪个面积最大?为什么?
答:园,你可以设一个周长a,则等边三角形的面积是三十六分分之根号3(0.048) 正方形:十六分之一,0.0625 圆就是四π分之一,0.0796详情>>