People See people love a+b

Source: Internet
Author: User

1093: People see love a+b time limit:1 Sec Memory limit:128 MB
submit:474 solved:174
[Submit] [Status] [BBS] Description

The ACM above already have 10来 road a+b of the topic, believe these topics were everyone's favorite, Hope today's a+b can bring good luck to everyone, also hope this topic can arouse everyone to ACM once love.
The subject of A and B is not a simple integer, but two times, A and b are composed of 3 integers, respectively, for example, if a is 34 45 56, the time represented by a is 34 hours 45 minutes 56 seconds.

Input

The input data is composed of multiple lines, first an integer n, the number of test instances, and then n rows of data, each line has 6 integer ah,am,as,bh,bm,bs, respectively, representing the time of day A and b corresponding to the second cent. The title ensures that all data is valid.

Output

For each test instance, the output is a+b, and each output is also made up of a time division of 3 parts, but also to meet the rules of timing (i.e., the value range of minutes and seconds in 0~59), each output is a row, and all the parts can be expressed in 32-bit integers.

Sample Input11 2 3 4 5 6Sample Output5 7 9HINT Source

Software Academy

#include <stdio.h>#include<string.h>intMain () {intN; scanf ("%d",&N);  while(n--)    {        inta[6],b[4]; Memset (A,0,sizeof(a)); memset (b,0,sizeof(b)); scanf ("%d%d%d%d%d%d", &a[0],&a[1],&a[2],&a[3],&a[4],&a[5]); b[0]=a[0]+a[3]; b[1]=a[1]+a[4]; b[2]=a[2]+a[5];  while(b[2]> -) {b[1]++; b[2]=b[2]- -; }         while(b[1]> -) {b[0]++; b[1]=b[1]- -; } printf ("%d%d%d\n", b[0],b[1],b[2]); }}

People See people love a+b

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.