package com.langsin.calednar
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
public class CalenaarDemo {
void run() throws ParseException {
String[] w = { "日", "一", "二", "三", "四", "五", "六" }
Scanner s = new Scanner(System.in)
System.out.println("请输入要查询的年份")
int y = s.nextInt()
System.out.println("请输入要查询的月份")
int m = s.nextInt()
for (String ws : w) {
System.out.print(ws + " ")
}
System.out.println()
Calendar cal = Calendar.getInstance()
cal.set(y, m - 1, 1)
// cal.set(cal.MONTH,m)
// cal.set(cal.DATE,1)
int a = cal.get(cal.DAY_OF_WEEK) - 1
// System.out.println(a)
for (int j = 0
System.out.print(" " + "-" + " ")
}
for (int i = 1
System.out.print(" " + i + " ")
cal.set(y, m - 1, i)
int h = cal.get(cal.DAY_OF_WEEK) - 1
if (h == 6) {
System.out.println()
}
}
}
public static void main(String[] args) throws ParseException {
new CalenaarDemo().run()
}
}