7-8 Then what time (10 points)

Sometimes people use four digits to indicate a time, such as 1106 for 11 o'clock and 6 minutes. Now, your program needs to calculate the end time based on the start time and the elapsed time.

Read in two numbers. The first number represents the current time with such four digits, and the second number represents the number of minutes. Calculate what time is the current time after so many minutes, and the result is also expressed as a four-digit number. When the hour is a single digit, there is no leading zero, that is, 5:30 is represented as 530. Note that the number of minutes represented by the second number may exceed 60, or it may be negative.

Input format:
Input two integers in one line, which are the start time represented by four digits and the number of minutes elapsed, separated by a space. Note: In the starting time, when the hour is a single digit, there is no leading zero, that is, 5:30 is represented as 530; the number of minutes elapsed may exceed 60, or it may be a negative number.

Output format:
output the end time represented by four digits. When the hour is a single digit, there is no leading zero. The title guarantees that the start time and end time are within the same day.

Input sample:

1120 110

**Sample output:

1310
#include<stdio.h>
int main (void)
{
    
    
	int a, b, c, d;
	scanf("%d %d", &a, &b);
	c=a/100*60+a%100;
	d=(c+b)/60*100+(c+b)%60;
	printf("%d", d);
	return 0;
}

Guess you like

Origin blog.csdn.net/weixin_45814538/article/details/108885943