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.
- Prepare
- Java
- Advanced
- Prime Checker
- Discussions
Prime Checker
Prime Checker
Sort by
recency
|
353 Discussions
|
Please Login in order to post a comment
Here is Prime checker in java solution - https://programmingoneonone.com/hackerrank-prime-checker-problem-solution-in-java.html
The problem description does not fit the code. For me the solution class is empty, there is no locked code.
import java.util.*;
class Prime { void checkPrime(int... numbers) { for (int i = 0; i < numbers.length; i++) { int num = numbers[i]; int count = 0;
}
public class Solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in);
}
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.; import java.lang.reflect.;
class Prime { public void checkPrime(int... numbers) { for (int num : numbers) { if (isPrime(num)) { System.out.print(num + " "); } } System.out.println(); }
}
public class Solution { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n1 = Integer.parseInt(br.readLine()); int n2 = Integer.parseInt(br.readLine()); int n3 = Integer.parseInt(br.readLine()); int n4 = Integer.parseInt(br.readLine()); int n5 = Integer.parseInt(br.readLine());
}