c语言求助

360U3330238232 |浏览1008次
收藏|2022/06/08 05:02

满意回答

2022/06/08 05:28

#include<stdio.h>void main(){int PI=3,v,r,h,total=20000;printf("输入水桶的底面半径和高:");scanf("%d %d",&r,&h);while(r<=0||h<=0){printf("水桶的半径和高必须是大于0的整数!\n\n");printf("输入水桶的底面半径和高:");scanf("%d %d",&r,&h);}v=PI*r*r*h;v%total>0?printf("%d",((v/total)+1)):printf("%d",(v/total));printf("\n");}

akyu2012

其他回答(0)
0人关注该问题
+1

 加载中...