题解 | #小乐乐定闹钟#
小乐乐定闹钟
https://www.nowcoder.com/practice/0f7e422e12be4a7f9958ca2a82abc775
#include<iostream> using namespace std; int main(){ int a,b,c; scanf("%d:%d %d",&a,&b,&c); int h,f; h=c/60; f=c%60; a=(a+h+(b+f)/60)>=24?(a+h+(b+f)/60)%24:(a+h+(b+f)/60); b=(b+f)>=60?((b+f)%60):(b+f); printf("%02d:%02d",a,b); return 0; }