%02d

小乐乐定闹钟

http://www.nowcoder.com/questionTerminal/0f7e422e12be4a7f9958ca2a82abc775

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("[: ]");
        int h = Integer.parseInt(s[0]), m = Integer.parseInt(s[1]), t = Integer.parseInt(s[2]);
        m = m + t;
        h = (h + m/60)%24;
        m = m%60;
        System.out.printf("%02d:%02d", h, m);
    }
}
全部评论

相关推荐

不愿透露姓名的神秘牛友
06-25 17:22
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务