extract.c
来自「emacs的一个非常有用的插件,叫xrefactory,可以实现source i」· C语言 代码 · 共 32 行
C
32 行
#include <stdio.h>/* Select marked region with mouse and press F11 or invoke 'Xref -> Refactor'. In the proposed menu move to the 'Extract Function' refactoring and press <return>. */void extractFunction() { int i,n,x,y,t; printf("Enter n: "); fflush(stdout); fscanf(stdin, " %d", &n); // region begin x=0; y=1; for(i=0; i<n; i++) { t=x+y; x=y; y=t; } // region end printf("%d-th fib == %d\n", n, x);}int main() { extractFunction(); return(0);}/* F5 will bring you back to Index*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?