#include "iostream.h"
main()
{ int n;
int a[20]={0},i;
a[0]=1;
a[1]=1;
cout<<"请输入一个20以内的整数,确定显示的个数:";
cin>>n;
for(i=2;i<=n-1;i++)
a[i]=a[i-1]+a[i-2];
for(i=0;i<=n-1;i++)
{
if(a[i]!=0)
cout<<a[i]<<" ";
}
cout<<endl;
}
main()
{ int n;
int a[20]={0},i;
a[0]=1;
a[1]=1;
cout<<"请输入一个20以内的整数,确定显示的个数:";
cin>>n;
for(i=2;i<=n-1;i++)
a[i]=a[i-1]+a[i-2];
for(i=0;i<=n-1;i++)
{
if(a[i]!=0)
cout<<a[i]<<" ";
}
cout<<endl;
}