⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fib.c

📁 一个电驴上下的51的CORE
💻 C
字号:
/* * Copyright (c) 1999-2000 Tony Givargis.  Permission to copy is granted * provided that this header remains intact.  This software is provided * with no warranties. * * Version : 2.8 *//*---------------------------------------------------------------------------*/#include <reg51.h>/*---------------------------------------------------------------------------*/void fib(unsigned char* buf, unsigned char n) {        char i;        buf[0] = 1;    buf[1] = 1;    for(i=2; i<n; i++) {                buf[i] = buf[i-1] + buf[i-2];    }}/*---------------------------------------------------------------------------*/void print(unsigned char* buf, unsigned char n) {        char i;        for(i=0; i<n; i++) {                P0 = buf[i];    }}/*---------------------------------------------------------------------------*/void main() {        unsigned char buf[10];        fib(buf, 10);    print(buf, 10);    while(1);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -