Bisiestos.java 557 Bytes
Newer Older
Cesar Giulano Gonzalez Maqueda committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
public class Bisiestos {
    public static void main(String []args){
        /*
        * Calculo de anhos bisiestos;
        * */
        System.out.println("Anhos bisiestos desde 1960 hasta hoy: ");
        int year_counter = 1960;
        do{
            if(year_counter%100 == 0){
                if(year_counter%400 == 0){
                    System.out.println(year_counter);
                }
            }else{
                System.out.println(year_counter);
            }
            year_counter += 4;
        }while(year_counter<2021);
    }
}