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<=30;i++){
  10. a[i+2]=-a[i+1]+a[i]+2;
  11. }printf("%d",a[30]);
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
2496122