输入一个日期,判断这天是该年的第几天
代码:
package com.qwh.javase.array;
import java.util.Scanner;
/*输入一个年月日,计算这一天是这一年的第几天*/
public class ArrayExer {
//声明年月日
int year,month,day;
//定义天数的数组
int[] arr = new int[]{
31,28,31,30,31,30,31,31,30,31,30,31};
//创建键盘输入
Scanner scanner = new Scanner(System.in);
//构造方法
public ArrayExer(){
}
//年
public void judgeYear(){
System.out.print("请输入年份:");
//键盘输入年份
year = scanner.nextInt();
//判断是否为闰年
if