import javax.swing.*;
import java.lang.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.Date;
import java.util.Scanner;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Comparator;
public class Main {
public static void main(String[] args) throws ParseException {
Scanner sc = new Scanner(System.in);
String s=sc.nextLine();
SimpleDateFormat d1=new SimpleDateFormat("yyyy MM");
SimpleDateFormat d2=new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.setTime(d1.parse(s));
for(int i=0;i<cal.get(Calendar.DAY_OF_MONTH);i++){
if(cal.get(Calendar.DAY_OF_WEEK)==1 ||cal.get(Calendar.DAY_OF_WEEK)==7){
System.out.println(d2.format(cal.getTime()));
}
cal.add(Calendar.DAY_OF_MONTH,1);
}
}
}
7-1 打印双休日 (20 分)
最新推荐文章于 2024-06-17 12:23:52 发布
关键词由CSDN通过智能技术生成