#define pi 3.14
#include<stdio.h>
void main()
{
int r,d,h;
float r=d/2;h=60;d=10;
v=pi*r*r*h/3;
printf("%f",v);
} 这题错了 不知道怎么改了
#include<stdio.h> #define PI 3.14 viod main() { float r; double...
include<stdio.h> define PI 3.14 void main(){ float r;double L,S1,S2,V;printf("请输入所要求的圆的半径r\\n");scanf("%f",&r);L=PI*2*r;S1=PI*r*r;S2=PI*4*r*r;V=(4.0\/3)*r*r*r*PI;printf("圆的周长L=%0.2lf",L);printf("\\n圆的面积S1=%0.2lf",S1);pr...
#include<stdio.h> #define PI 3.14 int main() {float s,v,r,h...
4、类似3.14这样的浮点常量,默认类型是double。如果想统一类型为float,严格来讲应该写成3.14f,不过问题不大。整理后代码如下:include<stdio.h>#define PI 3.14int main(){ float s, v, r, h; scanf("%f%f", &r, &h); s = PI*r*r; v = 4.0 * PI*r*r*r \/ 3; printf("...
如何用c语言输入3.14的圆柱的高和半径?
include<stdio.h> define PI 3.14 int main(){ float R,V,H;printf("请输入半径和高:");scanf("%f%f",&R,&H);V=PI*R*R*H;printf("圆柱的体积为%.2lf",V);return 0;}
...h>#include<stdio.h> #define pi 3.14 main() { float r,s,v; p...
include<stdio.h> define pi 3.14 int main(){ float r,h,s,v;printf("请输入圆柱体的半径:");scanf("%f",&r);printf("请输入圆柱体的高:");scanf("%f",&h);s=pi*r*r*2+2*pi*r*h;v=pi*r*r*h;printf("圆柱表面积为:%f\\n",s);printf("圆柱体积为:%f\\n",v);return...
c语言顺序结构程序 立体几何计算题怎么编写啊啊?求解
include <stdio.h>#include <stdlib.h>#define PI 3.14 \/\/宏定义pi等于3.14int main(){ float r,h; float c1;\/\/保存计算圆的周长 float Sb;\/\/保存圆的表面积 float Vb;\/\/保存圆柱的体积 printf("请输入圆的半径r=:\\n"); scanf("%f",&r);\/\/输入圆的半径 ...
c语言计算圆球周长和体积,保留一位小数
C语言实现如下:include <stdio.h> define Pi 3.14 void main(){ float R,c,v;scanf("%f",&R);\/\/输入圆球的半径。c=(float)(Pi*R*2);\/\/计算周长。v=(float)(4.0\/3*R*R*R*Pi);\/\/计算体积。printf("圆球周长为%0.1f\\n",c);printf("圆球体积为%0.1f",v);} ...
...用scanf函数让用户输入圆的半径,存放在变量r中,再求圆周长、圆面积...
include <stdio.h>#define PI 3.14int main(){ float r;\/\/半径 float s; \/\/周长 float area; \/\/面积 float area_s; \/\/表面积 float v;\/\/体积 scanf("%f",&r); s = PI * 2 * r; area = PI * r * r; area_s = 4 * PI * r * r; ...
用c语言求圆的面积
用c语言求圆的面积编程如下:include <stdio.h> include <math.h> define PI 3.14 void main(){ float r;double c;double s;printf("请输入半径的值:");scanf("%f",&r);s=PI*r*r;printf("这个圆的面积是:%f\\n",s);
C语言编程如何用程序计算一个圆球的体积
C语言编程求圆球体积如下:include <stdio.h> define pi 3.1415926 int main(){ double r;printf("请输入球体的半径:");scanf("%lf",&r);printf("球体的表面积为:%.2lf\\n",4*pi*r*r);printf("球体的体积为:%.2lf\\n",4.0\/3*pi*r*r*r);return 0;...
c语言 编程序求半径为r、高为h的圆柱体体积。
include <stdio.h>#define Pi 3.14int main(void){ float r,h; printf("Please input the radius and hight of the cylinder:"); scanf("%f%*c%f",&r,&h); printf("The result is:%f\\n",Pi * r * r * h); return 0;} ...