Description
输入年份和月份,打印当月所有双休日日期,打印格式为:“2018-06-16”
Input
年份和月份
Output
双休日日期
Sample Input
2018 6
Sample Output
2018-06-02 2018-06-03 2018-06-09 2018-06-10 2018-06-16 2018-06-17 2018-06-23 2018-06-24 2018-06-30
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class Main {
public static void main(String[] args) throws ParseException {
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
SimpleDateFormat df = new SimpleDateFormat("yyyy MM");
SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.clear();
cal.setTime(df.parse(str));
for(int i = 0;i < cal.get(Calen