網頁

2010年11月1日 星期一

GCD(10^10+1, 10^11+2)=?

GCD(10^10+1, 10^11+2)=?

55 則留言:

  1. 網誌管理員已經移除這則留言。

    回覆刪除

  2. public class B9833115 {
      static  long gcd (long x, long y)
      
        {
          long  r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
        long x=10000000001L;
        long y=100000000002L;
            long a=gcd(x,y);
              
                System.out.println(gcd(x,y));
        }
    }

    回覆刪除
  3. /**
     * @(#)sweet.java
     *
     *
     * @author
     * @version 1.00 2010/11/1
     */

    public class sweet
    {
       static long gcd(long x,long y)
          {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
          }
        static public void main(String gcd[])
        {
          long x=10^10+1;
          long y=10^11+2;
          System.out.print("gcd最大公因數:"+gcd(x,y));
        }      
    }

    回覆刪除
  4. public class david {
       static long asd(long x ,long y)
       {
          long r=x%y;
          if (r==0) return y;
          else
             return asd(y,r);
       }
       static public void main(String arg[])
       {
       long x=10000000001L;
       long y=100000000002L;
       System.out.println(asd(x,y));

    回覆刪除
  5. public class b9833103 {
        static  long gcd (long x, long y)
      
        {
         long r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
          long x=10000000001L;
          long y=1000000000002L;
             long a=gcd(x,y);
              
                System.out.println(gcd(x,y));
        }
    }

    回覆刪除
  6. /**
     * @(#)jave1101.java
     *
     *
     * @author
     * @version 1.00 2010/11/1
     */

    public class jave1101 {
      static long GCD(long x,long y){
          long r=x%y;
          if(r==0)
             return y;
          else
             return GCD(y,r);
      }
        public static void main(String[] args){
          System.out.println("考前練習--GCD(10^10+1, 10^11+2)=?\n");
          long A=10;
          for(int i=0;i<9;i++)
             A*=10;
          A+=1;
          long B=10;
          for(int i=0;i<10;i++)
             B*=10;
          B+=2;
          System.out.println("A="+A+".B="+B+"\n");
          long Q=GCD(B,A);
          System.out.println("\n\t答案--GCD(10^10+1, 10^11+2)="+Q);
        }
    }

    回覆刪除
  7. public class b9833107 {
     static  long gcd (long x, long y)
      
        {
          long r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
          long x=10000000001L;
          long y=100000000002L;
             long a=gcd(x,y);
              
                System.out.println(gcd(x,y));
        }

    回覆刪除
  8. public class b123 {
         static long gcd(long x ,long y)
           {
        long r = x%y;
        if(r==0)return y;
      &
    nbsp; else
          return gcd(y,r);
        }
       
        public static void main(String[] args)
        {
          long x=10000000001L;
          long y=100000000002L;
          long a=gcd(x,y);
          System.out.println(gcd(x,y));
         
        }
       
    }

    回覆刪除

  9. public class B9833115 {
      static  long gcd (long x, long y)
      
        {
          long  r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
        long x=10000000001L;
        long y=100000000002L;
            long a=gcd(x,y);
              
                System.out.println(gcd(x,y));
        }
    }

    回覆刪除
  10. /**
     * @(#)aaa.java
     *
     *
     * @author
     * @version 1.00 2010/11/1
     */

    public class aaa {
      
    static long gcd (long x,long y)
    {
       long r = x % y;
       if (r==0)return y;
       else
          return gcd (y,r);
    }   
    public static void main(String[] args)
    {
       long x=10000000001L;
       long y=100000000002L;
       long a=gcd(x,y);
      
       System.out.println(gcd(x,y));
         
    }

     
     
     
    --------------------Configuration: <Default>--------------------
    1
    Process completed.

    回覆刪除
  11. public class a {
     static long gcd(long x,long y)
     {
       long i = x%y;
       if(i==0)return y;
       else
          return gcd(y,i);
         
     }
        public static void main(String[] args)
        {
          long x=10000000001L;
          long y=100000000002L;
          long a=gcd(x,y);
          System.out.println(gcd(x,y));
        }
       
    }
    --------------------------------------
    1
    Process completed.

    回覆刪除
  12. public class GCD {
    static long gcd(long x,long y)
    {
       long r = x % y;
       if (r==0) return y;
       else
          return gcd (y,r);
    }  
       public static void main (String[] args)
       {
          long x = 10000000001L;
          long y = 100000000002L;
          long a = gcd(x,y);
         
          System.out.println(gcd(x,y));
       }
       
    }

    回覆刪除
  13. public class GCD {
      
       static long gcd (long x, long y)
       {
             long r = x % y;
            
             if(r == 0) return y;
            
             else
               
             return gcd(y,r);   
         
         
          }
        public static void main (String argv[])
          {
             long x = 10000000001L ;
            
             long y = 100000000002L;
            
            long a = gcd(x,y);
            
             System.out.println(gcd(x,y));   
            
        }  
       
    }

    回覆刪除
  14. public class david {
       static long david(long x ,long y)
       {
          long r=x%y;
          if (r==0) return y;
          else
             return david(y,r);
       }
       static public void main(String arg[])
       {
       long x=10000000001L;
       long y=100000000002L;
       System.out.println(david(x,y));
       } 
    }

    回覆刪除
  15. public class b9833103 {
        static  long gcd (long x, long y)
      
        {
         long r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
          long x=10000000001L;
          long y=1000000000002L;
             long a=gcd(x,y);
              
                System.out.println(gcd(x,y));
        }
    }
    --------------------Configuration: <Default>--------------------
    1
    Process completed.

    回覆刪除
  16. --------------------Configuration: --------------------
    1

    Process completed.

    回覆刪除
  17. public class ex6
       {
        static long gcd(long x,long y)
        {
          long r=x%y;
          if(r==0)return y;
          else
             return gcd(y,r);
        }
        public static void main(String ggd[])
        {
          long x=10^10+1L,y=10^11+2L;
          System.out.print("gcd:"+gcd(x,y));
        }
    }

    回覆刪除
  18. public class GCD {
      
       static long gcd (long x, long y)
       {
             long r = x % y;
            
             if(r == 0) return y;
            
             else
               
             return gcd(y,r);   
         
         
          }
        public static void main (String argv[])
          {
             long x = 10000000001L ;
            
             long y = 100000000002L;
            
            long a = gcd(x,y);
            
             System.out.println(gcd(x,y));   
            
        }  
       
    }

    回覆刪除
  19. public class text {
        public static void main(String[] erg) {
          long i=10000000001L,j=100000000002L;
          System.out.println(i);
          System.out.println(j);
          System.out.print("GCD:"+gcd(i,j));
              }
      
       public static long gcd(long x,long y){
          long r=x%y;
          if (r==0)
          return y;
          else return gcd(y,r);
          } 
    }

    回覆刪除
  20. /**
     * @(#)Gc.java
     *
     *
     * @author
     * @version 1.00 2010/11/1
     */

    public class Gc {
       static long gcd(long x,long y)
       {
          long r=x%y;
          if(r==0)return y;
          else
             return gcd(y,r);
       }
    public static void main(String [] argv)
    {
          long x=10000000001L;
          long y=100000000002L;
       System.out.println(gcd(x,y));}
    }

    回覆刪除

  21. public class EX789 {
    static long  gcd(long  x,long  y)
    {
       long  r=x%y;
       if(r==0)
       return y;
       else
       return gcd(y,r);
    }
    public static void main(String[]args)
    {
       long x=100000000001L;
       long y=1000000000002L;
       System.out.println("最大公因數="+gcd(x,y));
         
    }
    }

    回覆刪除
  22. public class b123 {

    static long gcd(long x ,long y)
    {
    long r = x%y;
    if(r==0)return y;
    else
    return gcd(y,r);
    }

    public static void main(String[] args)
    {
    long x=10000000001L;
    long y=100000000002L;
    long a=gcd(x,y);
    System.out.println(gcd(x,y));

    }

    }

    回覆刪除
  23. public class EX06 {
       static long gcd (long x,long y)
          {
             long r=x%y;
             if(r==0)return y;
             else
                return gcd (y,r);
                          
        }
        static public void main(String[]args)throws Exception
                {
             long x=1000000001L;
             long y=10000000002L;
             System.out.println(gcd(x,y));
         
          }
       
    }

    回覆刪除
  24. public class GCD {
        static long gcd(long x,long y)
       {
          long r=x%y;
          if(r==0)return y;
          else
          return gcd(y,r);
         
        }
       
        public static void main(String[]args)throws Exception
        {
          long x=1000000001L;
          long y=10000000001L;
          System.out.print(gcd(x,y));
        }
       
    }

    回覆刪除
  25. /**
    * @(#)sweet.java
    *
    *
    * @author
    * @version 1.00 2010/11/1
    */


    public class sweet
    {
    static long gcd(long x,long y)
    {
    long r=x%y;
    if(r==0)
    return y;
    else
    return gcd(y,r);
    }
    static public void main(String gcd[])
    {
    long x=10^10+1;
    long y=10^11+2;
    System.out.print("gcd"+gcd(x,y));
    }
    }

    回覆刪除
  26. public class GCD {
    static long gcd(long x,long y)
    {
       long r = x % y;
       if (r==0) return y;
       else
          return gcd (y,r);
    }  
       public static void main (String[] args)
       {
          long x = 10000000001L;
          long y = 100000000002L;
          long a = gcd(x,y);
         
          System.out.println(gcd(x,y));
       }
       
    }

    回覆刪除
  27. public class B9833116 {
        static  long gcd (long x, long y)
      
        {
          long r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
          long x=10000000001L;
          long y=100000000002L;
             long a=gcd(x,y);
                System.out.println(gcd(x,y));
        }

    回覆刪除
  28. public class ex1 {
    static long gcd(long x,long y)
    {
       long r=x%y;
          if(r==0) return y;
          else
             return gcd(y,r);       
    }
    public static void main (String[] args)throws Exception
    {
       long x=10000000001L;
       long y=100000000002L;
       System.out.println(gcd(x,y));
    }
       
       
    }

    回覆刪除

  29. public class B9833115 {
      static  long gcd (long x, long y)
      
        {
          long  r=x%y;
          if (r==0)return y;
               else
                return gcd (y,r);
        }
        public static void main(String arg[])
        {
        long x=10000000001L;
        long y=100000000002L;
            long a=gcd(x,y);
              
                System.out.println(gcd(x,y));
        }
    }
     
    --------------------Configuration: <Default>--------------------
    1
    Process completed.

    回覆刪除
  30. public class EX789 {
    static long  gcd(long  x,long  y)
    {
       long  r=x%y;
       if(r==0)
       return y;
       else
       return gcd(y,r);
    }
    public static void main(String[]args)
    {
       long x=100000000001L;
       long y=1000000000002L;
       System.out.println("最大公因數="+gcd(x,y));
         
    }
    }
     

    回覆刪除

  31. public class B9833118 {
        static long gcd(long x,long y) {
        long r=x%y;
        if (r==0) return y;
        else return gcd(y,r);
        }
         
       public static  void main (String arg[])
        {
          long x=10000000001L;
          long y=100000000002L;
         
          long i=gcd(x,y);
          System.out.println(gcd(x,y));
        }
        
        
       
        }

    回覆刪除
  32. public class EX1 {
      
    static long gcd (long x,long y)
       {
          long r=x%y;
             if(r==0)return y;
             else
             return gcd(y,r);
       }
    public static void main (String[] args)throws Exception
    {
     long x=10000000001L;
     long y=100000000002L;
                     
     System.out.println(gcd(x,y));
    }
                  
                  
                  
    }

    回覆刪除
  33. public class EX06 {
       static long gcd (long x,long y)
          {
             long r=x%y;
             if(r==0)return y;
             else
                return gcd (y,r);
                          
        }
        static public void main(String[]args)throws Exception
                {
             long x=1000000001L;
             long y=10000000002L;
             System.out.println(gcd(x,y));
         
          }
       
    }

    回覆刪除
  34. public class B9833089 {
    static long gcd(long x,long y)
          {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
          }
        static public void main(String gcd[])
        {
          long x=10^10+1,y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
        } 

    回覆刪除
  35. /**
     * @(#)gcd.java
     *
     *
     * @author
     * @version 1.00 2010/11/1
     */

    public class gcd
    {
         static long gcd(long x,long y)
         {
          long r=x%y;
          if(r==0)
             return y;
           else
           return gcd(y,r);
           }
         static public  void main (String gcd[])
          {
             long x=10^10+1;
             long y=10^11+2;
             System.out.printf("gcd是:"+gcd(x,y));
                 }
    }

    回覆刪除
  36. /**
     * @(#)b9833062.java
     *
     *
     * @author
     * @version 1.00 2010/11/1
     */

    public class b9833062 {static long gcd(long x,long y)
          {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
          }
        static public void main(String gcd[])
        {
          long x=10^10+1,y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
        }
    }

    回覆刪除
  37. public class B9833068 {
    static long gcd(long x,long y)
          {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
          }
        static public void main(String gcd[])
        {
          long x=10^10+1,y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
        } 

    回覆刪除
  38. public class two {
      
       static long gcd(long x,long y)
       {
          long r=x%y;
          if(r==0) return y;
          else
             return gcd(y,r);
         
          }
    public static void main (String[] avgs)throws Exception
    {
       long x=10000000001L;
       long y=100000000002L;
      
       System.out.println(gcd(x,y));
      
       }
     
       
       
    }

    回覆刪除
  39. public class ex4
    {
        static long gcd(long x,long y)
        {
          long r=x%y;
          if(r==0)return y;
          else
             return gcd(y,r);
        }
        static public void main(String gcd[])
        {
          long x=10^10,y=10^11;;
          System.out.print("gcd:"+gcd(x,y));
        }
       
    }

    回覆刪除
  40. public class EX1 {
    static long gcd (long x,long y)
    {
      long r=x%y;
      if(r==0) return y;
      else
       return gcd(y,r);
      
    }   
    public static void main (String[] avgs) throws Exception
    {
       long x=10000000001L;
       long y=100000000002L;
    System.out.println(gcd(x,y));
    }  
       
       
       
       
    }

    回覆刪除
  41. public class B9633018 {

    static long gcd(long x,long y) {
    long r=x%y;
    if (r==0) return y;
    else return gcd(y,r);
    }

    public static void main (String arg[])
    {
    long x=10000000001L;
    long y=100000000002L;

    long i=gcd(x,y);
    System.out.println(gcd(x,y));
    }



    }

    回覆刪除
  42. public class B9633039 {

    static long gcd(long x,long y) {
    long r=x%y;
    if (r==0) return y;
    else return gcd(y,r);
    }

    public static void main (String arg[])
    {
    long x=10000000001L;
    long y=100000000002L;

    long i=gcd(x,y);
    System.out.println(gcd(x,y));
    }



    }

    回覆刪除
  43. public class B9833096 {
       static long gcd (long x, long y)
       {
          long r = x % y;
          if(r==0)return y;
          else
          return gcd (y,r);
         
       }
        public static void main(String argv[])
        {
          long x = 100000000001L;
         
          long y = 1000000000002L;
         
          long a = gcd (x,y);
         
          System.out.println(gcd(x,y));
        
        }
       
       
    }

    回覆刪除
  44. public class b9833114   {
        static long gcd (long x, long y)
      {
          long r = x % y;
          if(r==0)return y;
          else
          return gcd (y,r);
         
      }
        public static void main(String argv[])
        {
          long x = 100000000001L;
         
          long y = 1000000000002L;
         
          long a = gcd (x,y);
         
          System.out.println(gcd(x,y));
       
        }
       
       
       
    }

    回覆刪除
  45. public class b9833110   {
        static long gcd (long x, long y)
      {
          long r = x % y;
          if(r==0)return y;
          else
          return gcd (y,r);
         
      }
        public static void main(String argv[])
        {
          long x = 100000000001L;
         
          long y = 1000000000002L;
         
          long a = gcd (x,y);
         
          System.out.println(gcd(x,y));
       
        }
      
       
       
    }

    回覆刪除
  46. public class TEX {
      static long gg(long a , long b)
      {
       long r=a%b ;
       if(r==0) return b;
       else return gg(b,r);
      
       }
      
       public static void main (String X[])
       {
          long a=10000000001L;
          long b=100000000002L;
         
          long i= gg(a,b);
          System.out.println(gg(a,b));
         
          }
       
       
    }

    回覆刪除
  47. public class hmgdgdk {
        static long min (long x,long y)
        {
        long r=x%y;
        if(r==0) return y;
        else
             return min(y,r);
        }
        static public void main(String yo[])
        {
          long x=10000000001L;
          long y=100000000002L;
          System.out.println(min(x,y));
    }
    }

    回覆刪除
  48. public class EX06 {
       static long gcd (long x,long y)
          {
             long r=x%y;
             if(r==0)return y;
             else
                return gcd (y,r);
                          
        }
        static public void main(String[]args)throws Exception
                {
             long x=1000000001L;
             long y=10000000002L;
             System.out.println(gcd(x,y));
         
          }
       
    }

    回覆刪除
  49. class gcd
    {
     static float gcd(float a,float b)
     {
      float r=a%b;
      if(r==0) return b;
      else return gcd(b,r);
     }
     static public void main(String args[])
     {
      System.out.println(gcd(100000000002l,10000000001l));
     }
    }

    回覆刪除
  50. public class B9833073
    {
       static long gcd(long x,long y)
          {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
          }
        static public void main(String gcd[])
        {
          long x=10^10+1,y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
        }      
    }

    回覆刪除

  51. public class gce {static long gcd(long x,long y)
    {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
     }
     static public void main(String gcd[])
      {
          long x=10^10+1;
          long y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
        }
    }

    回覆刪除
  52. public class b {static int gcd(int x,int y)
          {
          int r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
          }
        static public void main(String gcd[])
        {
          int x=10^10+1,y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
        }
    }

    回覆刪除
  53.  
    public class b {static long gcd(long x,long y)
    {
          long r=x%y;
          if(r==0)
             return y;
          else
             return gcd(y,r);
    }
     

     static public void main(String gcd[])
     {
          long x=10^10+1,y=10^11+2;
          System.out.print("gcd:"+gcd(x,y));
     }
    }

    回覆刪除
  54. class gcd
    {
     static float gcd(float a,float b)
     {
      float c=a%b;
      if(c==0) return b;
      else return gcd(b,c);
     }
     static public void main(String args[])
     {
      System.out.println(gcd(10000000001l,100000000002l));
     }
    }

    回覆刪除
  55. public class B9833062 {
     
      public static void main(String arg[])      
      {
       long f[] = new long [51];
       f[0]= f[1]= 1;
     
       for (int n=2;n<51;n++)
       {
        f[n]=f[n-1]+f[n-2];
        System.out.println(n+"->"+f[n]);
       
       }
       
      }
      }

    回覆刪除

HTML 編輯器