#include <stdio.h>
int get_tu_zi_count(int);
int main(int argc,char *argv[])
{
int i,count;
for (i=1;i<21;i++)
{
count = get_tu_zi_count(i);
printf("%d ",count);
}
system("pause");
return 0;
}
int get_tu_zi_count(int count)
{
if (count == 2 || count == 1)
{
return 1;
}
else
{
return get_tu_zi_count(count - 1) + get_tu_zi_count(count - 2);
}
}
|