HDOJ 2033 人见人爱A+B
来源:互联网 发布:什么叫网络设计? 编辑:程序博客网 时间:2024/06/07 00:55
Problem Description
HDOJ上面已经有10来道A+B的题目了,相信这些题目曾经是大家的最爱,希望今天的这个A+B能给大家带来好运,也希望这个题目能唤起大家对ACM曾经的热爱。
这个题目的A和B不是简单的整数,而是两个时间,A和B 都是由3个整数组成,分别表示时分秒,比如,假设A为34 45 56,就表示A所表示的时间是34小时 45分钟 56秒。
Input
输入数据有多行组成,首先是一个整数N,表示测试实例的个数,然后是N行数据,每行有6个整数AH,AM,AS,BH,BM,BS,分别表示时间A和B所对应的时分秒。题目保证所有的数据合法。
Output
对于每个测试实例,输出A+B,每个输出结果也是由时分秒3部分组成,同时也要满足时间的规则(即:分和秒的取值范围在0~59),每个输出占一行,并且所有的部分都可以用32位整数表示。
Sample Input
2
1 2 3 4 5 6
34 45 56 12 23 34
Sample Output
5 7 9
47 9 30
import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(n-->0){ int aH = sc.nextInt(); int aM = sc.nextInt(); int aS = sc.nextInt(); int bH = sc.nextInt(); int bM = sc.nextInt(); int bS = sc.nextInt(); int cH,cM,cS; int m; cS = (aS+bS)%60; m=(aS+bS)/60; cM = (aM+bM+m)%60; m=(aM+bM+m)/60; cH = aH+bH+m; System.out.println(cH+" "+cM+" "+cS); } }}
0 0
- HDOJ 2033 人见人爱A+B
- HDOJ 2033 人见人爱A+B
- HDOJ 2033 人见人爱A+B
- HDOJ 2033 人见人爱A+B
- hdoj.2033 人见人爱A+B 20140729
- hdoj 2033 ( 人见人爱A+B ) C++
- hdoj 2033 人见人爱A+B (水)
- hdoj 2033人见人爱A+B 解题报告
- C++ hdoj 2033 人见人爱A+B
- HDOJ 2035: 人见人爱A^B
- HDOJ 2034 人见人爱A-B
- 【HDOJ】2034 -> 人见人爱A-B
- HDOJ 2035.人见人爱A^B
- 人见人爱A^B hdoj 2035
- hdoj 2034 人见人爱A-B
- hdoj 2035 人见人爱A^B
- HDOJ 人见人爱A-B 2034
- HDOJ--2035--人见人爱A^B
- UITabBarController来管理多个UIViewController以及导航栏的加入
- Linux下如何使用锐捷
- pycharm输出中文为乱码
- mac myEclipse 更改jre版本
- git将本地项目推送到远程
- HDOJ 2033 人见人爱A+B
- front/back与begin/end
- 线程
- Python 高级特性之 filter( )
- 【慕课笔记】第六章 数组 第4节 使用Arrays类操作JAVA中的数组
- 电源的反向保护二极管及作用?
- hdu 4725 The Shortest Path in Nya Graph //spfa
- android 彻底杀死进程
- requests有关cookie的使用