import java.util.Scanner;
public class Cle{
public static void main(String[] args) {
// TODO Auto-generated method stub
int r;
float mj,zc;
float PI=3.14f;//定义圆周率=3.14
System.out.println("请输入圆的半径:");
Scanner sc=new Scanner(System.in);
r=sc.nextInt();
mj=PI*r*r;//计算圆的面积
zc=2*PI*r;//计算圆的周长
System.out.println("圆的面积:"+mj);
System.out.println("圆的周长:"+zc);
}
}
结果如下: