17-10-5

作业一:简单输出

#include 

int main()
{
      printf("Hello C's world!\n");
      return 0
}

作业二:计算圆面积

#include 
#double PI 3.14
double calculateVolume (int radius);
int main ()
{
      int cRadius = 0;
      double volume = 0.0;
      printf ("请输入圆的半径:\n");
      scanf ("%d", &cRadius);
      volume = calculateVolume (cRadius);
      printf ("圆的面积是:%f\n", volume);
      return 0;
}
double calculateVolume (int radius)
{
      double result = PI*radius*radius;
      return result;
}

你可能感兴趣的:(17-10-5)