DSTJZ


私信TA

用户名:dotcpp0721777

访问量:6810

签 名:

天下难事,必作于易;天下大事,必作于细。

等  级
排  名 49
经  验 11647
参赛次数 13
文章发表 324
年  龄 18
在职情况 学生
学  校 狗熊岭23届毕业生
专  业

  自我简介:

TA的其他文章


参考代码:

import java.time.LocalDate;
import java.util.Scanner;

public class Main
{	public static void main(String[] args)
	{	Scanner scanner = new Scanner(System.in);
		int []start = new int[3];
		int []end = new int[3];
		for(int i = 0; i < 3; i++)
			start[i] = scanner.nextInt();
		for(int i = 0; i < 3; i++)
			end[i] = scanner.nextInt();
		LocalDate a = LocalDate.of(start[0], start[1], start[2]);
		LocalDate b = LocalDate.of(end[0], end[1], end[2]);
		int res = 0;
		while(a.isBefore(b))
		{	a = a.plusDays(1);
			res++;
		}
		System.out.println(res);
	}
}


 

0.0分

6 人评分

  评论区

  • «
  • »