fork download
  1. #include<stdio.h>
  2. int main( )
  3. { int i;
  4. int n=5;
  5. int f[20];
  6. for(i=0;i<n;i++)
  7. {
  8. if(i==0||i==1)
  9. {
  10. f[i]=i;
  11.  
  12. }
  13.  
  14. else f[i]=f[i-1]+f[i-2];
  15.  
  16. }
  17.  
  18. printf("%d",f[n-1]);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 9416KB
stdin
5
stdout
3