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