l17.1c
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1C 代码 · 共 51 行
1C
51 行
#printPrint the 20 Fibonacci numbers beginning with 2(the sequence is 2,3,5,8,... where each numberis the sum of the immediately preceding pair of numbers.Start with the pair 1,1).Print each number on a separate line as a five digitnumber (remember %3d in printf? %5d does five digits).Compile and test your program; then type "ready".#once #create Ref 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 67651094617711#usera.out >xxx#cmp xxx Ref#succeed/* one way */main(){ int f1, f2, t, count; f1 = 1; f2 = 1; for (count = 0; count < 20; count++) { t = f1+f2; f1 = f2; f2 = t; printf("%5d\n", t); }}#log#next18.1a 10
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?