fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=1,b=2,c,i,q,ans=0;
  5. for(i=1;c<1000;i++)
  6. {
  7. c = 3 * b + 2 * a;
  8. a = b;
  9. b = c;
  10. q = (c >= 100) && (c <= 1000);
  11. ans += q;
  12. }
  13. printf("answer:%d",ans);
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
answer:2