fork(4) download
  1. class Shit {
  2. public static int factorial(int n) {
  3. if (n <= 2) {
  4. return 1;
  5. } else {
  6. return factorial(n-1)+3*factorial(n-2);
  7. }
  8. }
  9.  
  10. public static void main(String[] args) {
  11. System.out.println(factorial(7));
  12. }
  13. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
97