#21845: for JAVA


SoulOfNag (拿各之魂)

學校 : 不指定學校
編號 : 39223
來源 : [176.67.80.251]
最後登入時間 :
2023-09-19 15:04:38
a263. 日期差幾天 -- 板橋高中練習題 | From: [64.145.91.0] | 發表日期 : 2020-07-24 15:40

換library後 就過了~

回饋一下:
import java.io.IOException;

import java.io.BufferedReader;

import java.io.InputStreamReader;

import java.time.LocalDate;

import java.time.temporal.ChronoUnit;

public class A263_14{

public static void main(String[] args) throws IOException{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

String str=br.readLine();

String[] strArray;

LocalDate d1,d2;

while(str!=null){

strArray=str.split(" ");

d1=LocalDate.of(Integer.parseInt(strArray[0]),Integer.parseInt(strArray[1]),Integer.parseInt(strArray[2]));

strArray=br.readLine().split(" ");

d2=LocalDate.of(Integer.parseInt(strArray[0]),Integer.parseInt(strArray[1]),Integer.parseInt(strArray[2]));

System.out.println(Math.abs(ChronoUnit.DAYS.between(d1,d2)));

str=br.readLine();

    }

  }

}

 
ZeroJudge Forum