#include <iostream> using namespace std; typedef long long ll; int main(){ int m; while(cin>>m){ if(m==0) break; ll small = 1; ll big = 0; ll temp; for(int i=0;i<m;i++){ temp = big; big = big + small; small = temp; } cout<<big+small<<endl; } } |
Double click to view unformatted code.