fork download
  1. class E286 {
  2. public static void main (String[] args) {
  3. rFactorial(3628800);
  4. rFactorial(479001600);
  5. rFactorial(6);
  6. rFactorial(18);
  7. }
  8.  
  9. private static void rFactorial(float in) {
  10. int ori = (int) in;
  11. int i;
  12.  
  13. for (i = 2; in > 1; i++)
  14. in /= i;
  15.  
  16. if (in == 1)
  17. System.out.printf("%d = %d!\n", ori, i-1);
  18. else
  19. System.out.printf("%d NONE\n", ori);
  20. }
  21. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
3628800 = 10!
479001600 = 12!
6 = 3!
18 NONE