#include <stdio.h> #define PI (3.1415926) // 定义圆周率PI int main() { float r, h; printf("请输入半径 r = "); scanf("%f", &r); printf("请输入圆柱高 h = "); scanf("%f", &h); printf("圆周长 = %.2f\n", 2 * PI * r); // 2 * π * r printf("圆面积 = %.2f\n", PI * r * r); // π * (r^2) printf("圆球体积 = %.2f\n", PI * r * r * r * 4 / 3.0); // (4/3) * π * (r^3) printf("圆柱体积 = %.2f\n", PI * r * r * h); // π * (r^2) * h return 0; }
I like this site very much, Its a rattling nice place to read and obtain info.Blog monetyze
magnificent submit, very informative. I’m wondering why the opposite specialists of this sector don’t understand this. You should continue your writing. I’m confident, you’ve a great readers’ base already!