您的位置:首页 > 编程语言

暑假编程训练---H:求圆柱体的表面积

2013-07-17 18:50 253 查看
Problem J:求圆柱体的表面积
Time Limit:1000MS Memory Limit:65536K

Total Submit:12 Accepted:5
Description

Input
输入底面半径r和高h
Output
输出圆柱体的表面积,保留3位小数
Sample Input

3.5 9


Sample Output

Area=274.889


Hint
注意:pi的计算为:const double pi=4.0 * atan(1.0);

或者直接赋值pi = 3.1415926
源代码:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
const double PI=4.0 * atan(1.0);
double r,h;
double Area;
scanf("%lf %lf",&r,&h);
Area=2*PI*r*h+2*PI*r*r;
printf("Area=%0.3lf",Area);
return 0;
}


[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: