import java.util.Scanner;
public class 输入某年某月某日并判断这一天是这一年的第几天 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.print("请输入3个整数,分别表示年月日:");
int year=in.nextInt();
int month=in.nextInt();
int day=in.nextInt();
int sum=0;
int[][] a={
{31,28,31,30,31,30,31,31,30,31,30,31},
{31,29,31,30,31,30,31,31,30,31,30,31}
};
for(int i=0;i<month-1;i++)
{
if(year%4==0&year%100!=0|year%400==0)
sum=sum+a[1][i];
else
sum=sum+a[0][i];
}
sum=sum+day;
System.out.println(year+"年"+month+"月"+day+"是这一年的第"+sum+"天");
}
}
public class 输入某年某月某日并判断这一天是这一年的第几天 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.print("请输入3个整数,分别表示年月日:");
int year=in.nextInt();
int month=in.nextInt();
int day=in.nextInt();
int sum=0;
int[][] a={
{31,28,31,30,31,30,31,31,30,31,30,31},
{31,29,31,30,31,30,31,31,30,31,30,31}
};
for(int i=0;i<month-1;i++)
{
if(year%4==0&year%100!=0|year%400==0)
sum=sum+a[1][i];
else
sum=sum+a[0][i];
}
sum=sum+day;
System.out.println(year+"年"+month+"月"+day+"是这一年的第"+sum+"天");
}
}