fork(1) download
  1. <?php
  2.  
  3. function normalize($num)
  4. {
  5. while ($num % 10 == 0)
  6. {
  7. $num = intdiv($num, 10);
  8. }
  9.  
  10. return ($num % 100);
  11. }
  12.  
  13. $k = 50; // 30414093201713378043612608166064768844377641568960512000000000000
  14. $result = 1;
  15.  
  16. for ($i = 2; $i <= $k; $i++)
  17. {
  18. $result = normalize($result * $i);
  19. }
  20.  
  21. echo $result % 10;
Success #stdin #stdout 0.02s 24236KB
stdin
Standard input is empty
stdout
2