#include<stdio.h>
int main(void)
{
long long i,n,narr[55];
narr[1]=1;narr[2]=2;narr[3]=3;
for(i=4;i<=50;i++)
{
narr[i]=narr[i-1]+narr[i-2];
}
while(scanf("%d",&n)!=EOF)
{
printf("%lld\n",narr[n]);
}
return 0;
}
2023-08-02 17:29:52
#include<stdio.h>
int main(void)
{
long long i,n,narr[55];
narr[1]=1;narr[2]=2;narr[3]=3;
for(i=4;i<=50;i++)
{
narr[i]=narr[i-1]+narr[i-2];
}
while(scanf("%d",&n)!=EOF)
{
printf("%lld\n",narr[n]);
}
return 0;
}