10月5号

作者: 17860780569 | 来源:发表于2017-10-10 17:49 被阅读0次

    #include#define PI 3.14

    double calculateVolume(int height,int radius);

    int main()

    {

    int cHeight = 0;

    int cRadius = 0;

    double volume = 0.0;

    printf("请输入圆柱体的高度:\n");

    scanf("%d",&cHeight);

    printf("请输入圆柱体底面圆的半径:\n");

    scanf("%d",&cRadius);

    volume = calculateVolume(cHeight,cRadius);

    printf("圆柱体的体积是:%f\n",volume);

    return 0;

    }

    double calculateVolume(int height,int radius)

    {

    double result = height*PI*radius*radius;

    return result;

    }

    相关文章

      网友评论

          本文标题:10月5号

          本文链接:https://www.haomeiwen.com/subject/rzkbyxtx.html