Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ModifyXMLFile {
- public static void factoFerma(long f){
- double s = Math.sqrt(f);
- long x = (long)s + 1;
- long y = 0;
- long a = 0;
- long b = 0;
- while(true){
- long w = x*x-f;
- if ((Math.sqrt(w)%1==0)){
- y = (long)Math.sqrt(w);
- a = x + y;
- b = x - y;}
- else {x = x+1;}
- long r = w - y*y;
- if (r==0){
- break;
- }
- }
- System.out.println("[" + a + "*" + b + "]");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement