1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 int count = 0; 6 for(int i = 2001; i <= 2100; i++) 7 { 8 if((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) 9 { 10 System.out.print(i + " "); 11 count++; 12 } 13 if(count == 10) 14 { 15 System.out.println(); 16 count = 0; 17 } 18 } 19 } 20 }
时间: 2024-12-06 09:41:59