#include
#define pi 3.1415926
int main(void)
{
double r,h;
double cperimeter,carea,bperimeter,bvolume;
double circleperimeter(double r);
double circlearea(double r);
double ballvolume(double r);
double ballperimeter(double r,double h);
printf("enter the r:");
scanf("%lf",&r);
printf("enter the height:");
scanf("%lf",&返历h);
cperimeter=circleperimeter(r);
carea=circlearea(r);
bperimeter=ballperimeter(r,h);
bvolume=ballvolume(r);
printf("the circle perimeter =%lf\n",cperimeter);
printf("the circle area=%lf\n",carea);
printf("the ball of volume =%lf\t\n",bvolume);
printf("the ball of perimeter =%lf\t\t",bperimeter);
return 0;
}
double circleperimeter(double r)
{
double item;
item=2*pi*r;
return item;
} 漏租搜
double circlearea(double r)
型贺 {
double result;
result=pi*r;
return result;
}
double ballvolume(double r)
{
double volume;
volume= (4*pi*r*r*r)/3;
return volume;
}
double ballperimeter(double r,double h)
{
double ballperimeter;
ballperimeter=4*r*pi+2*pi*r*h;
return ballperimeter;
}