- /**Recursion Demo 3
- * @author TK Rogers
- * @version 11-06-09
- */
- public class
Mystry {
- public
static void main ( ) {
-
System.out.println ( mystry ( 3 ) ) ;
- }
-
-
public static int mystry ( int y ) {
-
System.out.println ( " y = " + y ) ;
- if
( y == 0 ) {
-
return 1 ;
- } else {
-
int x = mystry ( y / 2 ) ;
-
-
x *= x ;
-
if ( y % 2 == 1 ) x *= 3 ;
-
return x ;
- }
- }
- }