fork download
  1. #include <iostream>
  2. using namespace std;
  3. long long t[1000];
  4.  
  5. int main() {
  6.  
  7. int n;
  8. cin >> n;
  9. t[1]=1;
  10. t[2]=1;
  11.  
  12. for(int i=3; i<=n; i++)
  13. {
  14. t[i]=t[i-1]+t[i-2];
  15. }
  16.  
  17. cout << t[n] << endl;
  18.  
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5320KB
stdin
100
stdout
3736710778780434371