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 scanner = new Scanner(System.in);
- int N = scanner.nextInt();
- int temp = N;
- for (int i=1; i<=N; i++){
- if (temp%2==0){
- System.out.println(2);
- temp/=2;
- } else if (temp%3==0){
- System.out.println(3);
- temp/=3;
- } else if (temp%5==0){
- System.out.println(5);
- temp/=5;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement