#include <stdio.h> int main() { int hour =0,minute = 0, k = 0; scanf("%d:%d %d",&hour,&minute,&k); hour += k/60; minute += k%60; //先加出总小时和总分钟 while(minute>=60) //格式转换 { minute -= 60; hour++; } if(hour>=24) { hour %= 24; } printf("%02d:%02d",hour,minute); return 0; }