1 package test1; 2 3 public class Cflow { run()4 public int run() { 5 return k1(4); 6 } 7 run2()8 public int run2() { 9 return fact(5); 10 } 11 fact(int n)12 public int fact(int n) { 13 if (n <= 1) 14 return n; 15 else 16 return n * fact(n - 1); 17 } 18 k1(int i)19 public int k1(int i) { 20 if (i > 1) 21 return k2(i - 1); 22 else if (i == 1) 23 return i; 24 else if (i == 0) 25 throw new RuntimeException(); 26 else 27 return -i; 28 } 29 k2(int i)30 public int k2(int i) { 31 if (i > 1) 32 return k1(i - 1); 33 else if (i == 1) 34 return i; 35 else if (i == 0) 36 throw new RuntimeException(); 37 else 38 return -i; 39 } 40 } 41