题解 | #小乐乐定闹钟#
小乐乐定闹钟
https://www.nowcoder.com/practice/0f7e422e12be4a7f9958ca2a82abc775
#include <stdio.h> int main() { int hour, min,howmin; scanf("%d:%d %d",&hour,&min,&howmin); hour = ((min + howmin)/60+hour)%24; min = (min + howmin)%60; printf("%02d:%02d\n",hour,min); return 0; }
%02d保证整数的输出至少为两位,不够两位在左侧补零