2025-02-03 17:23:54 +01:00
|
|
|
public class Progression {
|
|
|
|
|
|
|
|
private int compte;
|
|
|
|
|
|
|
|
public void plusUn() {
|
|
|
|
this.compte++;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
return Integer.toBinaryString(this.compte);
|
|
|
|
}
|
|
|
|
|
2025-02-03 17:29:00 +01:00
|
|
|
public Progression(int valeur_debut) {
|
|
|
|
this.compte = valeur_debut;
|
2025-02-03 17:23:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
2025-02-03 17:29:00 +01:00
|
|
|
Progression compteur = new Progression(5);
|
|
|
|
|
|
|
|
for (int i = 5; i <= 9; i++){
|
|
|
|
System.out.println(compteur);
|
|
|
|
compteur.plusUn();
|
|
|
|
}
|
|
|
|
}
|
2025-02-03 17:23:54 +01:00
|
|
|
}
|