Solve problem 80 using Java.