题解 | #牛牛的水杯#
牛牛的水杯
https://www.nowcoder.com/practice/c196c47c23394bf3bdd4f82a838df6bf
#include <stdio.h> int main() { int h,r,p; float V=0; scanf("%d %d",&h ,&r); V=3.14*0.001*h*r*r;//单位换算 p=(int)(10/V);//强制类型转换,即舍去小数部分 if(p==(10/V)) { printf("%d",p); } else printf("%d",p+1); return 0; }