暑假编程训练---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
Sample Output
Hint
注意:pi的计算为:const double pi=4.0 * atan(1.0);
或者直接赋值pi = 3.1415926
源代码:
[/code]
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]
相关文章推荐
- 暑假编程训练---K:判断是否直角三角形
- 编程:求圆柱体的表面积
- 暑假编程训练---L:求多项式
- 用C语言编程,根据用户输入的半径计算球的表面积,体积,经过圆心的横切圆的面积以及以此球的半径、直径作为直径和高的圆柱体的侧面积、表面积和体积(将π定义成值为3.14的符号常量)
- 暑假编程训练---E:年龄问题
- 暑假编程训练---F:平方和与立方和
- 暑假编程训练---G:计算直线的交点数
- 暑假编程训练---B:人见人爱A^B
- 暑假编程训练----A:乘法口诀
- 暑假编程训练---C:8 984 阶乘和
- 暑假编程训练---D:打印金字塔
- 输出圆柱体的表面积
- 暑假训练(二) 等待的题目
- OpenCV编程->Haar训练(2)
- 暑假训练-训练8.5 KMP
- 例题1-1 圆柱体的表面积
- 第七周项目二(3)计算圆柱体的表面积
- 【暑假训练 7.10】 codevs 2492 上帝造题的七分钟2
- 第七周项目三圆柱体的表面积
- hpu暑假训练 B - Bridging signals 【LIS】