标签:style blog ar color sp java for on div
如果13号是星期五,就称为“黑色星期五”,好像是耶稣死的日子
1 package com.fj; 2 3 import java.util.Calendar; 4 5 public class BlackFriday { 6 private static final int CURRENT_DAY = 13; 7 public static void main(String[] args) { 8 Calendar cal = Calendar.getInstance(); 9 int year = cal.get(Calendar.YEAR); 10 int month = cal.get(Calendar.MONTH); 11 for (int j = 0; j < 10; j++) { 12 for (int i = month; i < 12; i++) { 13 cal.set(year, i, CURRENT_DAY); 14 int a = cal.get(Calendar.DAY_OF_WEEK); 15 if (a == 6) { 16 System.out.println(cal.get(Calendar.YEAR)+"年"+(cal.get(Calendar.MONTH)+1) +"月"+ cal.get(Calendar.DAY_OF_MONTH) 17 +"日 是黑色星期五"); 18 } 19 } 20 month = 0; 21 year++; 22 } 23 } 24 }
标签:style blog ar color sp java for on div
原文地址:http://www.cnblogs.com/f644135318/p/4141295.html