题解 | #牛牛的水杯#
牛牛的水杯
https://www.nowcoder.com/practice/c196c47c23394bf3bdd4f82a838df6bf
using System; public class Program { public static void Main() { string[] s = Console.ReadLine().Split(" "); double[] d = 字符串数组转浮点数数组(s); double d1 = 3.14*d[0]*Math.Pow(d[1], 2); if((10000%d1) != 0) { Console.WriteLine("{0:F0}", Math.Truncate(10000 / d1)+1); } else { Console.WriteLine("{0:F0}",10000/d1); } //Console.WriteLine("{0:F0}",3.14*d[0]*Math.Pow(d[1], 2)); } public static double[] 字符串数组转浮点数数组(string[] arr) { double[] d = new double[arr.Length]; for (int i = 0; i < arr.Length; i++) { d[i] = double.Parse(arr[i]); } return d; } }