fork download
  1. // Как же странно работать с этим BigInteger, вместо плюсов/минусов здесь
  2. // какие-то шайтан методы аля .subtract.
  3. static BigInteger factorial(BigInteger n)
  4. {
  5. if (!n.equals(BigInteger.ZERO))
  6. {
  7. return n.multiply(factorial(n.subtract(BigInteger.ONE)));
  8. }
  9. else
  10. {
  11. return BigInteger.ONE;
  12. }
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class, interface, or enum expected
    static BigInteger factorial(BigInteger n)
           ^
Main.java:8: error: class, interface, or enum expected
        }
        ^
Main.java:12: error: class, interface, or enum expected
        }
        ^
3 errors
stdout
Standard output is empty