Código [Seleccionar]
puedes solucionarlo poniendoles condiciones al numero asi pos consola este metodo los muestra bien
Código (java) [Seleccionar]
import java.util.Iterator;
import java.util.Random;
import java.util.SortedSet;
import java.util.TreeSet;
public class ds {
public static void main(String[] args){
System.out.println(" X | f(X) ");
System.out.println(" ________|__________");
SortedSet<Integer> rs = new TreeSet<Integer>();
for(int index=0;index<14;index++)
rs.add(new Random().nextInt(900));
Iterator<Integer> r = rs.iterator();
while(r.hasNext()){
int x = r.next();
if(x<9)
System.out.println(" "+x+ " | "+" "+x);
else if(x<99)
System.out.println(" "+x+ " | "+" "+x);
else
System.out.println(" "+x+ " | "+" "+x);
}
}
}
Saludos!