解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n=Integer.parseInt(scanner.next()); while(n-->0) { int ah=scanner.nextInt(); int am=scanner.nextInt(); int as=scanner.nextInt(); int bh=scanner.nextInt(); int bm=scanner.nextInt(); int bs=scanner.nextInt(); int cm=(as+bs)/60;//秒向分钟进位 int ch=(am+bm+cm)/60;//分钟向小时进位 int cs=(as+bs)%60;//当前秒 cm=(am+bm+cm)%60;//当前分钟 ch=ah+bh+ch;//当前小时 System.out.println(ch+" "+cm+" "+cs); } } }
0.0分
0 人评分
A+B for Input-Output Practice (V) (C语言代码)浏览:629 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:887 |
WU-蓝桥杯算法提高VIP-企业奖金发放 (C++代码)浏览:1196 |
sizeof的大作用 (C语言代码)浏览:1516 |
1012题解浏览:899 |
字符逆序 (C语言代码)浏览:631 |
简单的a+b (C语言代码)浏览:667 |
回文数(一) (C语言代码)浏览:1133 |
Manchester-The 3n + 1 problem浏览:1397 |
检查一个数是否为质数 (C语言代码)浏览:764 |