fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a[33],i,sum;
  6. a[0]=2; a[1]=-1; sum=0;
  7. for(i=0;i<32;i++)
  8. {
  9. a[i+2]=-a[i+1]+a[i]+2;
  10. }
  11. for(i=0;i<=33;i++)
  12. {
  13. if(a[i]%4==0)
  14. sum=sum+a[i];
  15. }
  16. printf("%d",sum);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
-11197752