杭电 2033 ( 人见人爱A+B ) java

来源:互联网 发布:无人机编程教材 编辑:程序博客网 时间:2024/05/16 10:43
import java.util.Scanner;public class Main {    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        int n = sc.nextInt();        int h = 0;        int m = 0;        int s = 0;        int q, w, e, r;        while (sc.hasNext()) {            while (n-- > 0) {                int AH, AM, AS, BH, BM, BS;                AH = sc.nextInt();                AM = sc.nextInt();                AS = sc.nextInt();                BH = sc.nextInt();                BM = sc.nextInt();                BS = sc.nextInt();                q = AS + BS;                w = q / 60;                s = q % 60;                e = AM + BM + w;                r = e / 60;                m = e % 60;                h = AH + BH + r;                System.out.println(h + " " + m + " " + s);                             }        }    }}

0 0