第二题我只过了30%,后面想想写了一下,应该没问题 public static double CalWater(int t, int m, int t1, int m1, int t2, int m2) { int enterWaterT = (t / (2 * t1)) * t1 + (Math.Min(t1, t % (2 * t1))); // 进水闸时长 int exitWaterT = (t / (2 * t2)) * t2 + (Math.Min(t2, t % (2 * t2))); // 出水阀时长 double enterWaterN = m1 * enterWaterT; double exitWaterN = m2 * exitWaterT; double result = Math.Max(0, Math.Min(m, enterWaterN - exitWaterN)); return result; }

相关推荐

不知道怎么取名字_:28届都开始出来找机会了,看来哪里都卷
实习简历求拷打
点赞 评论 收藏
分享
我要娶个什么名:学长你电脑闹鬼了
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务