直接上代码
package test1;
public class 周长面积计算器 {
public static void main(String[] args) {
//下面是圆
final double π = 3.14;
int r = 100;
int d = 2*r;
double yuanzhouchang = d*π;
double yuanmianji = π*r*r;
System.out.println("这个圆的周长是:"+yuanzhouchang);
System.out.println("这个圆的面积是:"+yuanmianji);
//下面是长方形
int a = 11;
int b = 22;
int changfangxingzhouchang = (a+b)*2;
int changfangxingmianji = a*b;
System.out.println("这个长方形的周长是:"+changfangxingzhouchang);
System.out.println("这个长方形的面积是:"+changfangxingmianji);
//下面是正方形
int c = 13;
int zhengfangxingzhouchang = 4*c;
int zhengfangxingmianji = c*c;
System.out.println("这个正方形的周长是:"+zhengfangxingzhouchang);
System.out.println("这个正方形的面积是:"+zhengfangxingmianji);
//下面是三角形
double e =