hdu-人见人爱A+B
来源:互联网 发布:雅思网络课程下载 编辑:程序博客网 时间:2024/05/17 23:38
http://acm.hdu.edu.cn/showproblem.php?pid=2033
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>using namespace std;int main(){ int n,h,m,s,i; int a[200]; cin>>n; while (n--) { for(i=0;i<6;i++) { cin>>a[i]; } h=a[0]+a[3]; m=a[1]+a[4]; s=a[2]+a[5]; while(s>60) { m++; s-=60; } while(m>60) { h++; m-=60; } cout<<h<<" "<<m<<" "<<s<<endl; } return 0;}
- hdu-人见人爱A^B
- hdu-人见人爱A+B
- hdu 人见人爱A^B
- HDU 人见人爱A^B
- 人见人爱A-B HDU
- 人见人爱A^B HDU
- 人见人爱A^B HDU
- (hdu 2035)人见人爱A^B
- HDU 2035 ( 人见人爱A^B )
- hdu 2033 人见人爱A+B
- HDU 2033 人见人爱A+B
- HDU 2035 人见人爱A^B
- hdu 2034 人见人爱A-B
- hdu 2035人见人爱A^B
- HDU 2035 人见人爱A^B
- HDU 2035 人见人爱A^B
- HDU 2035 人见人爱A^B
- hdu 2034 人见人爱A-B
- java.lang.IllegalArgumentException java.sql.Date.getHours的解决方案(SSH)
- 【读书笔记】OOD启思录
- QQ 中所使用的GIPS语音技术
- android input system(frameworks) analysis -- InputManager (2)
- (Android) MediaPlayer Example
- hdu-人见人爱A+B
- 【读书笔记】SQL必知必会
- Android 在XML中引用系统资源方法
- Android UEventObserver
- HttpClient的例子
- 【读书笔记】编程大师访谈录
- 【读书笔记】程序员修炼之道
- tk2d的摄像头和tilemap研究
- Web开发人员推荐12款优秀的 Twitter Bootstrap 组件和工具