fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. int a[100],n;
  4. scanf("%d",&n);
  5. a[1]=1;a[2]=1;
  6. for (int i=3;i<=n;i++)
  7. a[i]=a[i-1]+a[i-2];
  8. printf("%d",a[n]);
  9. return 0;
  10. }
Success #stdin #stdout 0.01s 5288KB
stdin
12
stdout
144