题解 | #小乐乐定闹钟#
小乐乐定闹钟
https://www.nowcoder.com/practice/0f7e422e12be4a7f9958ca2a82abc775
#include <stdio.h> int main() { int k,hour,minute=0; scanf("%d:%d",&hour,&minute); scanf("%d",&k); hour+=k/60; minute+=k%60; if(minute>=60){ minute-=60; hour+=1; } while(hour>24){ hour-=24; } printf("%02d:%02d",hour,minute); return 0; }
c语言刷题 文章被收录于专栏
c语言刷题题目