题解 | #获得月份天数#
获得月份天数
http://www.nowcoder.com/practice/13aeae34f8ed4697960f7cfc80f9f7f6
import java.time.LocalDate;
import java.util.Scanner;
/**
* @author zmstart
* @create 2022-03-18 22:18
*/
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNextInt()) {
int y = scan.nextInt();
int m = scan.nextInt();
LocalDate localDate1 = LocalDate.of(y, m, 1);
System.out.println(localDate1.lengthOfMonth());
}
}
}