Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- int a,b,c,i,d;
- cin>>a;
- b = 1;
- c = 1;
- if (a == 1){
- cout<<2;
- }
- else{
- for(i=0;i<a-1;++i){
- d = c;
- c = c + b;
- b = d;
- }
- }
- cout<<b+c;
- cout<<"\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement