Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main(){
- int n;
- cin>>n;
- int tn = 1;
- int tn_1 = 0;
- int tn_2 = 0;
- for(int i=1 ; i<=n ; i++){
- tn_2 = tn_1;
- tn_1 = tn;
- tn = tn_2 + tn_1;
- }
- cout<<tn;
- return 0;
- }
Advertisement
Advertisement