参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); double v = 50. / 60; double sum = 0; while(n-- != 0) { int a = scanner.nextInt(); int b = scanner.nextInt(); int number = scanner.nextInt(); double c = Math.sqrt(a * a + b * b); sum += c / v * 2 + 1.5 * 60 * number; } int res = (int)Math.ceil(sum / 60); System.out.println(res); } }
0.0分
5 人评分