人见人爱A+B
来源:互联网 发布:拼图软件 编辑:程序博客网 时间:2024/06/06 03:12
人见人爱A+B
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 37106 Accepted Submission(s): 24687
Problem Description
HDOJ上面已经有10来道A+B的题目了,相信这些题目曾经是大家的最爱,希望今天的这个A+B能给大家带来好运,也希望这个题目能唤起大家对ACM曾经的热爱。
这个题目的A和B不是简单的整数,而是两个时间,A和B 都是由3个整数组成,分别表示时分秒,比如,假设A为34 45 56,就表示A所表示的时间是34小时 45分钟 56秒。
这个题目的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
21 2 3 4 5 634 45 56 12 23 34
Sample Output
5 7 947 9 30
#include <iostream>#include <stdio.h>#include <cstring>using namespace std;int main(){ int t; cin>>t; while(t--) { int AH,AM,AS,BH,BM,BS; while(scanf("%d%d%d%d%d%d",&AH,&AM,&AS,&BH,&BM,&BS)!=EOF) { int h,m,s; if(BS+AS>59) { s=BS+AS-60; AM++; } else { s=BS+AS; } if(AM+BM>59) { m=AM+BM-60; AH++; } else { m=AM+BM; } h=AH+BH; cout<<h<<" "<<m<<" "<<s<<endl; } } return 0;}
0 0
- A - 人见人爱A^B
- HDOJ2035 人见人爱A^B
- 人见人爱A^B
- 2033 人见人爱A+B
- 2034 人见人爱A-B
- 2035 人见人爱A^B
- hdu_2033_人见人爱A+B
- hdu_2034_人见人爱A-B
- hdu_2035_人见人爱A^B
- 2035: 人见人爱A^B
- 人见人爱A-B
- [ACM]人见人爱A^B
- hdoj_2033 人见人爱A+B
- hdoj_2034 人见人爱A-B
- hdoj_2035 人见人爱A^B
- hdu-人见人爱A^B
- hdu-人见人爱A+B
- HDU_2033 人见人爱A+B
- java 中static final用法
- Leetcode Everyday: 344. Reverse String
- JAVA004--3种循环对比,for;while;do{}while
- CentOS/RedHat和Debian/Ubuntu安装VMware Tools时无法找到kernel header path的解决方案
- 懵懵懂懂搭建数据库环境(流程主导,工作分解)
- 人见人爱A+B
- 字符串处理(库函数)
- 杭电1269-Tarjan算法
- 258. Add Digits [easy] (Python)
- Cocos2d-x 3.9 + VS2012 + BabeLua 如何搭建cocos2dx lua环境
- Stanford 机器学习 Anomaly Detection
- hihoCoder1301 筑地市场(统计符合条件数字,数位dp)
- 匈牙利算法模板及解释
- Hibernate中的级联策略和object references an unsaved transient instance - save the transient instance before