You are viewing a single comment's thread. Return to all 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); }}
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #192: Best Approximations
You are viewing a single comment's thread. Return to all comments →
help me out
{
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(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); }}