Project Euler #192: Best Approximations

Sort by

recency

|

3 Discussions

|

  • + 0 comments

    Any Solution of this challenge?

  • [deleted]
    + 0 comments

    i dint understand the question. in the sample input where n was 3, why did denominator for root(2) is calculated. Should we find the denominators for all the squares of numbers below n.

  • + 0 comments

    help me out

    public static void main(String args[]) 
    

    {
    Scanner in = new Scanner(System.in); int array[]=new int[2]; int m = in.nextInt(); int b = in.nextInt(); int c,d; int sum=0; int j,k;double f,h;

        for(int i=2; i<= m; i++)
        { c=0; d=0;   array[0]=0;array[1]=0; 
               double e=0; h=1.0;
    

    for(k=2; k

    //System.out.println(f); if((f

    } g=f; h=f; //System.out.println(array[1]); }

    }
    

    sum=sum+array[1]; System.out.println(array[0]+"/"+array[1]); } System.out.println("sum="+sum); }}

No more comments