• + 0 comments

    Here my code

    class Result {
        public static boolean isPrime(int p){
            for(int i = 2 ; i<=p/i ; i++){
                if(p%i==0)
                    return false;
            }
            return true;
        }
        public static int primeCount(long n) {
            long acum = 1;
            int count = 0;
            for(int i = 2 ; acum<=n/i ; i++){
                if(isPrime(i)){
                    acum*=i;
                    count++;
                }
            }
            return count;
        }
    }