JAVA programming hundred cases 71