题解 | #牛牛的水杯#
牛牛的水杯
https://www.nowcoder.com/practice/c196c47c23394bf3bdd4f82a838df6bf
#include <stdio.h> int main() { double h = 0; double r = 0; double pi = 3.14; scanf("%lf %lf", &h, &r); double v = pi * r * r * h; //求出一杯水的容积 int i = 0; while (v * i <= 10000) { i++; } //求出需要的杯数 printf("%d", i); return 0; }