题解 | 取近似值
using System; public class Program { public static void Main() { string[] T = Console.ReadLine().Split('.'); int L = int.Parse(T[0]); double R = double.Parse("0." + T[1]); if (R >= 0.5) { L = L + 1; } Console.WriteLine(L); } }
using System; public class Program { public static void Main() { string[] T = Console.ReadLine().Split('.'); int L = int.Parse(T[0]); double R = double.Parse("0." + T[1]); if (R >= 0.5) { L = L + 1; } Console.WriteLine(L); } }
相关推荐