import java.math.BigInteger; import java.util.PriorityQueue; public class problem29 { public static void main(String[] args) { PriorityQueuea = new PriorityQueue (); int c =0; for (int i = 2; i <= 100; i++) { for (int j = 2; j <= 100; j++) { BigInteger e = BigInteger.valueOf(i); e = e.pow(j); if(!a.contains(e)) { a.add( e); c++; } } } System.out.println(c); } }
No hay comentarios:
Publicar un comentario