标签:
1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 for(int i = 2000; i <= 2010; i++) 6 System.out.printf("%d\t%d\n", i, numberOfDaysInAYear(i)); 7 } 8 9 public static int numberOfDaysInAYear(int year) 10 { 11 if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) 12 return 366; 13 else 14 return 365; 15 } 16 }
标签:
原文地址:http://www.cnblogs.com/wood-python/p/5792367.html