Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Task3_5_1 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int num = sc.nextInt();
- int i = 2;
- while (i <= num) {
- if ((num % i) == 0) {
- System.out.print(i + " ");
- num /= i;
- }
- else i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment