Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long l,i,a,b,ans;
- while(scanf("%lld",&l)==1)
- {
- if(l==0)
- {
- break;
- }
- else
- {
- a=0;
- b=1;
- for(i=1;i<=l;i++)
- {
- ans=a+b;
- a=b;
- b=ans;
- }
- printf("%lld\n",ans);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement