题解 | #带空格直角三角形图案#
小乐乐定闹钟
http://www.nowcoder.com/practice/0f7e422e12be4a7f9958ca2a82abc775
#include using namespace std; void tim(long long time,int hour,int min){ hour+=time/60; min+=time%60; if(min>=60){ hour+=min/60; min=min%60; } if(hour>=24) hour=hour%24; if(hour<10&&min<10) cout<<"0"<<hour<<":"<<"0"<<min; else if(min<10) cout<<hour<<":"<<"0"<<min; else if(hour<10) cout<<"0"<<hour<<":"<<min; else cout<<hour<<":"<<min; } int main(){ int hour,min,b; char a; long long time; cin>>hour>>a>>min>>time; tim(time, hour, min); return 0; }