解题思路:
注意事项:
参考代码:
public class 人见人爱A加B_未解决 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int N = in.nextInt(); while (N != 0) { int[] times = new int[6]; for (int i = 0; i < times.length; i++) { times[i] = in.nextInt(); } int[] sumtimes = new int[3]; if (times[2] + times[5] > 59) { sumtimes[2] = times[2] + times[5] - 60; times[1]++; } else { sumtimes[2] = times[2] + times[5]; } if (times[1] + times[4] > 59) { sumtimes[1] =times[1] + times[4] - 60; times[0]++; } else { sumtimes[1] = times[1] + times[4]; } sumtimes[0] =times[0] + times[3]; for (int i = 0; i < sumtimes.length; i++) { System.out.print(sumtimes[i] + " "); } System.out.println(); N--; } } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题8.3 (Java代码)浏览:1402 |
C语言训练-斐波纳契数列 (C语言代码)浏览:1271 |
C语言训练-立方和不等式 (C语言代码)浏览:779 |
母牛的故事 (C语言代码)浏览:478 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:806 |
母牛的故事 (C语言代码)浏览:1045 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:594 |
Pascal三角 (C语言代码)浏览:707 |
图形输出 (C语言代码)浏览:1019 |
C语言程序设计教程(第三版)课后习题10.7 (用指针求解)浏览:1542 |