Guest User

Untitled

a guest
Nov 5th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import java.math.BigDecimal;
  2.  
  3. public class ID3 {
  4. public static void main(String[] args) {
  5. findFactors(600851475143L);
  6. }
  7.  
  8. public static void findFactors(long input){
  9. BigDecimal holder = BigDecimal.valueOf(input);
  10. for(long i = 2; i <= holder; i++){
  11. while(input % i == 0){
  12. System.out.println(input);
  13. input = input/i;
  14. }
  15. }
  16.  
  17. }
  18.  
  19. }
Add Comment
Please, Sign In to add comment