3 条题解

  • 0
    @ 2023-11-9 13:12:57

    #include <stdio.h>

    int main() { int n = 30; int first = 0, second = 1, next; int count = 2;

    printf("%d %d ", first, second);

    while (count < n) { next = first + second; printf("%d ", next); count++;

    if (count % 5 == 0) { printf("\n"); }

    first = second; second = next;

    }

    return 0;

    }

    【基础题】菲波拉契数列(2)

    信息

    ID
    50
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    60
    已通过
    19
    上传者