Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- // read input number (which will be between 2 and 1000)
- int number = Integer.parseInt(sc.nextLine());
- // factor the number into an array of prime factors
- int[] factors = factorize(number);
- // print array of factors
- for (int i = 0; i < factors.length; i++) {
- System.out.print(factors[i]);
- if (i != factors.length - 1) {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- public static int[] factorize(int number) {
- // TODO implement this
- //throw new UnsupportedOperationException();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement