|
#include<stdio.h>
#include<math.h>
#define PI 3.14
double find_circum(double);
double find_area(double);
int
main(void)
{
double radius;
double circum;
double area;
printf("lease enter the radius >");
scanf("%f",&radius);
circum=find_circum(radius);
area=find_area(radius);
printf("The circum is %f.\n",circum);
printf("The area is %f.\n",area);
return 0;
}
double
find_circum(double r)
{
return(2.0*PI*r);
}
double
find_area(double r)
{
return(pow(r,2)*PI);
}
一段简单的代码如上,为何输出结果总是零?唉... |
|