25 lines
469 B
Java
25 lines
469 B
Java
public class Progression {
|
|
|
|
private int compte;
|
|
|
|
public void plusUn() {
|
|
this.compte++;
|
|
}
|
|
|
|
public String toString() {
|
|
return Integer.toBinaryString(this.compte);
|
|
}
|
|
|
|
public Progression(int valeur_debut) {
|
|
this.compte = valeur_debut;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
Progression compteur = new Progression(5);
|
|
|
|
for (int i = 5; i <= 9; i++){
|
|
System.out.println(compteur);
|
|
compteur.plusUn();
|
|
}
|
|
}
|
|
} |