fork download
  1. public class Main {
  2. public static void main (String[] args) {
  3. int 閏年の個数 = 0 ;
  4. for (int year=1990 ; year<=2045 ; year++) {
  5. if (year%4==0 && year%100!=0 || year%400==0) {
  6. ++閏年の個数 ;
  7. System.out .println (閏年の個数 + ": " + year) ;
  8. }
  9. }
  10. }
  11. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
1: 1992
2: 1996
3: 2000
4: 2004
5: 2008
6: 2012
7: 2016
8: 2020
9: 2024
10: 2028
11: 2032
12: 2036
13: 2040
14: 2044