wrong answer from UVa 3n+1
<p>I have tried to submit many times and I got wrong answer.
<a href="https://uva.onlinejudge.org/index.php?option=com_onlinejudge&amp;Itemid=8&amp;page=show_problem&amp;problem=36" rel="nofollow">https://uva.onlinejudge.org/index.php?option=com_onlinejudge&amp;Itemid=8&amp;page=show_problem&amp;problem=36</a>
I found a solution on the website that does the same thing as my code, so I submitted his to make sure, it was accepted.
Can anybody tell me what might be wrong in my code?</p>

<pre><code>import java.util.Scanner;

class Main
{
public static void main(String[] args) 
{
    Scanner input = new Scanner(System.in);

    int count, max_count = 0;

    while(input.hasNext())
    {
        //get input
        int i = input.nextInt();
        int j = input.nextInt();

        int k = Math.min(i, j);
        while(k &lt;= Math.max(i, j))
        {
            count = findCycleLength(k);

            if(count &gt; max_count)
                max_count = count;

            k++;
        }
        System.out.printf("%d %d %d\n", i, j, max_count);
    }

} //end main

private static int findCycleLength(int n)
{
    int length = 1;
    while(n != 1)
    {
        if(n%2 == 1)
            n = 3*n + 1;
        else
            n /= 2;

        length += 1;
    }

    return length;
}

}
</code></pre>