shenyunwen
/*计算求n个圆柱的体积*/
#include<stdio.h>
int main(void)
{
    int i,n,r,h;/*r为圆柱底面的半径,h为原著的高*/
    double v;/*v为原著的体积*/
    printf("the enter n:");
    scanf("%d",&n);
    for(i=1;i<=n;i++){
    printf("the enter r:");
    scanf("%d",&r);
    printf("the enter h:");
    scanf("%d",&h);
        if(r<=0||r<=0)
        printf("The Enter is wrong");
        else
        v=3.14*r*r*h;
    printf("v=%.2f\n",v);
        }
    return 0;
}

 

分类:

技术点:

相关文章:

  • 2021-12-08
  • 2022-01-21
  • 2022-02-20
  • 2022-02-22
  • 2022-01-29
  • 2022-02-21
  • 2021-12-11
猜你喜欢
  • 2022-02-03
  • 2021-12-19
  • 2021-12-02
  • 2022-02-15
  • 2021-12-01
  • 2021-12-22
  • 2021-07-16
相关资源
相似解决方案