📄 fact1.c
字号:
#include <stdlib.h>#include <stdio.h>static unsigned long count;longfact(int x) { ++count; /* fact(0) is 1, negative numbers don't make sense so we pretend * they're 1. */ if (x < 2) return 1; return x * fact(x - 1);}intmain(void) { int i; long f; for (i = 1; i < 20; ++i) { count = 0; f = fact(i); printf("fact(%02d) gives %ld after %lu iteration%s.\n", i, f, count, count == 1 ? "" : "s"); } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -