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; }