设圆半径为5,圆柱高为3,求圆周长、圆面积、圆球表面积、圆球体积、圆柱体积。 编程序,用 scanf 输入数据,输出计算结果。输出时要有文字说明,取小数点后两位数字...

圆周长:31.42,圆面积:78.54,圆球表面积:150.80,圆球体积:523.60,圆柱体积:471.24。 以下是程序:#include <stdio.h> int main(){ int r, h; float pi = 3.14159; scanf("%d %d", &r, &h); float circumference = 2 * pi * r; float area_circle = pi * r * r; float area_sphere = 4 * pi * r * r; float volume_sphere

猜你喜欢

转载自blog.csdn.net/weixin_35756373/article/details/129551708
今日推荐