We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public class Solution {
private static Map primeMap = new HashMap<>();
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for(int a0 = 0; a0 < t; a0++){
long n = in.nextLong();
for(long i=n;i>2;i--){
if(n%i!=0)
continue;
Project Euler #3: Largest prime factor
You are viewing a single comment's thread. Return to all comments →
public class Solution { private static Map primeMap = new HashMap<>(); public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for(int a0 = 0; a0 < t; a0++){ long n = in.nextLong(); for(long i=n;i>2;i--){ if(n%i!=0) continue;
}