HDU 2033 人见人爱A+B(水~)
来源:互联网 发布:韩国网络爆红65g 编辑:程序博客网 时间:2024/05/21 14:50
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
Solution
水题
Code
#include<cstdio>#include<iostream>using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int h1,h2,m1,m2,s1,s2; cin>>h1>>m1>>s1>>h2>>m2>>s2; int s=(s1+s2)%60; int m=(m1+m2+(s1+s2)/60)%60; int h=h1+h2+(m1+m2+(s1+s2)/60)/60; printf("%d %d %d\n",h,m,s); } return 0;}
0 0
- HDU 2033 人见人爱A+B(水~)
- HDU 2034 人见人爱A-B(水~)
- HDU 2035 人见人爱A^B(水~)
- hdu 2033 人见人爱A+B
- HDU 2033 人见人爱A+B
- HDU-2033人见人爱A+B
- HDU 2033 人见人爱A+B
- HDU 2033 人见人爱A+B
- hdu-2033-人见人爱A+B
- HDU 2033 - 人见人爱 A + B
- hdu 2033 人见人爱A+B
- [hdu 2033] 人见人爱A+B
- hdu-2033-人见人爱A+B
- HDU 2033 人见人爱A+B
- HDU 2033 人见人爱A+B
- HDU 2033 人见人爱A+B
- HDU 2033 人见人爱A+B
- hdu 2033 人见人爱A+B
- B、淘汰汽车-------(计蒜之道 测试赛)
- android播放音频文件(MediaPlayer)和录音(MediaRecorder)--录音
- C#中的delegate与event简单讲解
- HDU 2032 杨辉三角(dp)
- ServletContext
- HDU 2033 人见人爱A+B(水~)
- 专注是通向成功的直通车
- multiprocessing在python中的高级应用-IPC 之 Pipe
- C、置换的玩笑-------(计蒜之道 测试赛)
- HDU 2034 人见人爱A-B(水~)
- 学习《算法导论》第六章 堆排序 总结二
- Android Binder 机制
- Html5 Blob
- leetcode 234 Palindrome Linked List(难易度:Easy)