题解 | #小乐乐定闹钟#
小乐乐定闹钟
https://www.nowcoder.com/practice/0f7e422e12be4a7f9958ca2a82abc775
#include <stdio.h> int main() { int h,m,k,i,j; scanf("%d:%d %d",&h,&m,&k); i=m+k; j=i%60; i=i/60; printf("%02d:%02d",(h+i)%24,j); return 0; }
要显示二位数可以用%02d来显示前导0