[PTA] 7-14 is then points (15 points)

Sometimes it is represented by a four-digit time, such as 11:00 1106 represents 6 minutes. Now, your program should be calculated according to the start time and end time of the passage of time.

Reading two numbers, the first number indicates the current time in such a four-digit, the second digit represents the number of minutes, then calculate the current time is elapsed after a few minutes, the results also indicated as four digits. When the hour digits, no leading zero, i.e. 5.30 expressed as 530. Note that the second number indicates the number of minutes could exceed 60, it may be negative.

Input format:
input given in row two integers, the starting time of each four digits, and the number of minutes elapsed, separated by a space therebetween. Note: At a starting time, when the single-digit hours, without leading zeros, i.e. 5.30 expressed as 530; the number may exceed 60 minutes elapsed, it could be negative.

Output Format:
Output termination time of four digits, digit hours when no leading zeroes. Topic ensure that the start time and end time on the same day.

Sample input:
1,120,110

Sample output:
1310

#include<stdio.h>
int main()
{
    int t,d,h,m;
    scanf("%d%d",&t,&d);
    h=t/100;
    m=t%100;
    t=h*60+m+d;
    h=t/60;
    m=t%60; 
    printf("%d",h*100+m);
}

Tip:
Take the first use /
take in addition to the rest of the first with%

Published 48 original articles · won praise 0 · Views 329

Guess you like

Origin blog.csdn.net/weixin_46399138/article/details/105332518