Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class numero_3 {
- static int max=0;
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- long nb=600851475143L;
- long td=System.nanoTime();
- test(nb);
- long tf= System.nanoTime();
- System.out.println((tf-td)/Math.pow(10,6));
- }
- public static void test(long nb){
- for(int i=2;i<=nb;i++){
- if(nb%i==0){
- test(nb/i);
- System.out.println(i);
- break;
- }else{
- if(nb==i){
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement