题解 | #计算日期到天数转换#
计算日期到天数转换
http://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded
利用LocalDate 类自带的方法
import java.util.Scanner;
import java.time.LocalDate;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String s = in.nextLine();
String[] ss = s.split(" ");
int yy = Integer.valueOf(ss[0]);
int mon = Integer.valueOf(ss[1]);
int dd = Integer.valueOf(ss[2]);
LocalDate ld = LocalDate.of(yy,mon,dd);
System.out.print(ld.getDayOfYear());
}
}