fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. int i,a[40];
  5.  
  6. a[0]=2;
  7. a[1]=-1;
  8.  
  9. for(i=0;i<=31;i++){
  10. a[i+2]=-a[i+1]+a[i]+2;
  11. }printf("%d",a[30]);
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5280KB
stdin
23
stdout
2496122