You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
274 B

  1. #include "c2logic/builtins.h"
  2. extern struct MindustryObject message1;
  3. double factorial(int x) {
  4. int ret = 1;
  5. for (int i = 2; i <= x; i++) {
  6. ret *= x;
  7. }
  8. return ret;
  9. }
  10. void main(void) {
  11. printd(factorial(4));
  12. print("\n");
  13. printd(factorial(5));
  14. printflush(message1);
  15. }