I’m stuck here. Do I just keep making new strings and turn them to int or us there a faster better way?
public void biggest(int a){
int random;
String aS = String.valueOf(a);
int ah=9;
if (a<10)
System.out.println(a);
for(int i= 0;i<aS.length();i++){
String firstNum = aS.substring(i,i+1);
for (int j = ah; j > Integer.parseInt(firstNum); j--){
System.out.println(ah);
}
}
} ```
Aucun commentaire:
Enregistrer un commentaire