题解 | #统计字符#

计算日期到天数转换

http://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded

import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String string = sc.nextLine(); String[] str = string.split(" "); Calendar c = Calendar.getInstance();

    c.set(Integer.parseInt(str[0]),Integer.parseInt(str[1])-1,Integer.parseInt(str[2]));
    System.out.println(c.get(Calendar.DAY_OF_YEAR));
}

}

全部评论

相关推荐

点赞 评论 收藏
分享
天降大厂offer:你是我见过最美的牛客女孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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