CSDN博客

img blade_sea

输入年月日,求出是第几周.

发表于2004/12/31 9:09:00  566人阅读

import java.util.Calendar;

class test{
  public static void main(String[] args){
    Calendar cal = Calendar.getInstance();

    int year = Integer.parseInt(args[0]);
    int month = Integer.parseInt(args[1]);
    int day = Integer.parseInt(args[2]);
    cal.set(year, month-1, day);

    System.out.println(cal.get(Calendar.WEEK_OF_MONTH));
    System.out.println(cal.get(Calendar.WEEK_OF_YEAR));
  }
}

阅读全文
0 0

相关文章推荐

img
取 消
img