Java小程序-计算圆的面积

import java.util.Scanner;

public class ComputeArea {//从控制台输入圆的半径,输出圆的面积
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System .out.print("Enter a number for radius: ");
		double radius = input.nextDouble();
		double area = radius * radius * 3.141592;
		System.out.println("The atea for the circle of radius "+radius+" is "+area);
	}
}

你可能感兴趣的:(Java学习笔记)