1. JAVA编程中求圆的面积怎么写

import java.util.Scanner;

//java 并不直接支持控制台输入,但可以使用Scanner类建立它的对象,已读取来System.in的输入

public class KongZhi {

public static void main(String[] args) {

Scanner input = new Scanner( System.in);

System.out.println("Enter a number for radius: ");

double radius = input.nextDouble();

double area= radius*radius*3.14;

System.out.println("The area for the circle of radius "+radius+" "+area);

}

}

(1)java编程代码扩展阅读

其他方法求圆的面积:

#include<stdio.h>

#include<math.h>

#define M=3.14

int main()

{

int r;

double s;

scanf("%d",&r);

s=M*pow(r,2);

printf("%0.7lf",s);

return 0;

}