You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
#include <stdio.h>
//fibonacci数列的第n项
int fibo(int n) {
if (n == 1 || n == 2) {
return 1;
}
return fibo(n - 2) + fibo(n - 1);
}
int main() {
int i;
for (i = 1; i <= 20; i++) {
printf("%d\t", fibo(i));
if (i % 10 == 0) {
printf("\n");
}
}
}