Skip to content

Instantly share code, notes, and snippets.

@dalcon10028
Created January 21, 2020 07:06
Show Gist options
  • Select an option

  • Save dalcon10028/c4daf267a42ef1c444708c5777e430cc to your computer and use it in GitHub Desktop.

Select an option

Save dalcon10028/c4daf267a42ef1c444708c5777e430cc to your computer and use it in GitHub Desktop.
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
sc.close();
int i=2;
while (N!=1) {
if(N%i==0){
System.out.println(i);
N/=i;
continue;
}
i++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment