int representGoal = (int) (graph.goal*representRatio+0.5); 只需要加0.5取整。 转载于:https://www.cnblogs.com/cl1024cl/p/6205556.html