1271: 圆柱体的表面积

来源:互联网 发布:易控王电脑监控软件 编辑:程序博客网 时间:2024/04/28 21:06

题目

Description

输入底边半径r和高h,输出圆柱体的表面积,保留三位小数。

Input

输入底边半径r和高h

Output

输出圆柱体的表面积,保留三位小数
Sample Input

3.5 9
Sample Output

Area=274.889


代码块

import java.util.Scanner;public class Main {    public static void main(String[] args) {        Scanner cn = new Scanner(System.in);        double r = cn.nextDouble();        double h = cn.nextDouble();        double s = Math.PI*Math.pow(r, 2)*2+Math.PI*r*2*h;        System.out.printf("Area=%.3f",s);    }}
原创粉丝点击