题解 | #计算日期到天数转换#
计算日期到天数转换
https://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded
import java.util.Scanner; import java.time.*; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.nextLine(); String[] ss = s.split(" "); LocalDate date = LocalDate.of(Integer.valueOf(ss[0]), Integer.valueOf(ss[1]), Integer.valueOf(ss[2])); System.out.println(date.getDayOfYear()); } }